From 59e6a9814a357162409b096300dd69f7db58f8bf Mon Sep 17 00:00:00 2001 From: Luck Date: Wed, 16 Nov 2022 21:26:05 +0000 Subject: Fix NPE from server config provider call (#268) --- .../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') 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 feefd66..59e873c 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 @@ -157,7 +157,9 @@ public abstract class AbstractSampler implements Sampler { try { ServerConfigProvider serverConfigProvider = platform.getPlugin().createServerConfigProvider(); - metadata.putAllServerConfigurations(serverConfigProvider.export()); + if (serverConfigProvider != null) { + metadata.putAllServerConfigurations(serverConfigProvider.export()); + } } catch (Exception e) { e.printStackTrace(); } -- cgit