From 97dfc55f0d2817d75bec547a4b60da5978a71408 Mon Sep 17 00:00:00 2001 From: Bram Date: Sun, 19 May 2024 13:49:38 +0200 Subject: [PATCH] Fixed: NullPointerException upon executing the /AntiHealthIndicator command --- .../deathmotion/antihealthindicator/commands/AHICommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platforms/spigot/src/main/java/com/deathmotion/antihealthindicator/commands/AHICommand.java b/platforms/spigot/src/main/java/com/deathmotion/antihealthindicator/commands/AHICommand.java index 6f2cb4d..8e77d10 100644 --- a/platforms/spigot/src/main/java/com/deathmotion/antihealthindicator/commands/AHICommand.java +++ b/platforms/spigot/src/main/java/com/deathmotion/antihealthindicator/commands/AHICommand.java @@ -56,7 +56,8 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command .getProtocolManager() .getUsers() .stream() - .filter(userStream -> userStream.getUUID().equals(((Player) sender).getUniqueId())) + .filter(user -> user != null && user.getUUID() != null) + .filter(user -> user.getUUID().equals(((Player) sender).getUniqueId())) .findFirst().ifPresent(user -> user.sendMessage(pcComponent)); return true;