diff --git a/docs/changelog_v3.3.x.md b/docs/changelog_v3.3.x.md index 1362005d6..cf5e21fde 100644 --- a/docs/changelog_v3.3.x.md +++ b/docs/changelog_v3.3.x.md @@ -14,7 +14,12 @@ These change logs represent the work that has been going on within prison. -# 3.3.0-alpha.18a 2024-05-29 +# 3.3.0-alpha.18a 2024-05-30 + + +* **Spigot utils: saw a rare situation where a NPE happened when prison had custom blocks setup, but the plugin was removed.** +This prevents a NPE if the backing 3rd plugin goes away. + * **Mine reset notifications: Forgot to add support for 'server' notification mode.** diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/SpigotUtil.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/SpigotUtil.java index e9bb0fcd6..395e78406 100644 --- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/SpigotUtil.java +++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/SpigotUtil.java @@ -178,11 +178,14 @@ public static ItemStack getItemStack( XMaterial xMaterial, int amount ) { public static SpigotItemStack getSpigotItemStackXMat( XMaterial xMaterial, int amount ) { SpigotItemStack itemStack = null; - try { - itemStack = new SpigotItemStack( getItemStack( xMaterial, amount ) ); - } - catch (PrisonItemStackNotSupportedRuntimeException e) { - // ignore + if ( xMaterial != null ) { + + try { + itemStack = new SpigotItemStack( getItemStack( xMaterial, amount ) ); + } + catch (PrisonItemStackNotSupportedRuntimeException e) { + // ignore + } } return itemStack;