From a10f966a443d56845a5efb1e65232e6b87eabb96 Mon Sep 17 00:00:00 2001 From: Luck Date: Wed, 29 Jun 2022 22:44:30 +0100 Subject: Fix NPE from null entity type name --- .../me/lucko/spark/common/platform/world/WorldStatisticsProvider.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spark-common/src/main/java/me') diff --git a/spark-common/src/main/java/me/lucko/spark/common/platform/world/WorldStatisticsProvider.java b/spark-common/src/main/java/me/lucko/spark/common/platform/world/WorldStatisticsProvider.java index 864a296..80c35a6 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/platform/world/WorldStatisticsProvider.java +++ b/spark-common/src/main/java/me/lucko/spark/common/platform/world/WorldStatisticsProvider.java @@ -122,6 +122,10 @@ public class WorldStatisticsProvider { String name = chunk.entityTypeName(key); int count = value.get(); + if (name == null) { + name = "unknown[" + key.toString() + "]"; + } + builder.putEntityCounts(name, count); combined.add(name, count); }); -- cgit