aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2022-10-02 20:16:03 +0100
committerLuck <git@lucko.me>2022-10-02 20:16:03 +0100
commitc4b1eccd9cd51e348983fab42ced78166f39cb0e (patch)
tree9c40474c268aafa51341c1fe82c0d0dcc88d456b /spark-common/src/main/java/me/lucko/spark/common
parentdbdd3eb1344b837abb13538b9c55d1d99e697e54 (diff)
downloadspark-c4b1eccd9cd51e348983fab42ced78166f39cb0e.tar.gz
spark-c4b1eccd9cd51e348983fab42ced78166f39cb0e.tar.bz2
spark-c4b1eccd9cd51e348983fab42ced78166f39cb0e.zip
Fix NPE caused by extraMetadataProvider being null
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/sampler/AbstractSampler.java4
1 files changed, 3 insertions, 1 deletions
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();
}