From c4b1eccd9cd51e348983fab42ced78166f39cb0e Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 2 Oct 2022 20:16:03 +0100 Subject: Fix NPE caused by extraMetadataProvider being null --- .../src/main/java/me/lucko/spark/common/sampler/AbstractSampler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'spark-common/src/main/java/me/lucko') diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/AbstractSampler.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/AbstractSampler.java index e20a2a8..6fc5a10 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/AbstractSampler.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/AbstractSampler.java @@ -156,7 +156,9 @@ public abstract class AbstractSampler implements Sampler { try { MetadataProvider extraMetadataProvider = platform.getPlugin().createExtraMetadataProvider(); - metadata.putAllExtraPlatformMetadata(extraMetadataProvider.export()); + if (extraMetadataProvider != null) { + metadata.putAllExtraPlatformMetadata(extraMetadataProvider.export()); + } } catch (Exception e) { e.printStackTrace(); } -- cgit