From e219103a2566a9432a7caf7fb98d0b3220f6cc40 Mon Sep 17 00:00:00 2001 From: Tomescu Vlad-Costin <55035625+DoubleNico@users.noreply.github.com> Date: Sat, 5 Aug 2023 22:02:41 +0300 Subject: [PATCH] Added a null check for the optional converter (#2485) --- src/main/java/com/comphenix/protocol/wrappers/Converters.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/comphenix/protocol/wrappers/Converters.java b/src/main/java/com/comphenix/protocol/wrappers/Converters.java index 39f7cc45..2479d392 100644 --- a/src/main/java/com/comphenix/protocol/wrappers/Converters.java +++ b/src/main/java/com/comphenix/protocol/wrappers/Converters.java @@ -168,6 +168,7 @@ public class Converters { @Override public Optional getSpecific(Object generic) { + if (generic == null) return Optional.empty(); Optional optional = (Optional) generic; return optional.map(converter::getSpecific); }