@@ -107,11 +107,14 @@ public void turnOff() {
107107 receiver .turnOff (getName ());
108108
109109 for (BlockFace blockFace : WirelessRedstone .getUtils ().getEveryBlockFace (true )) {
110- if (receiver .getLocation () != null ) {
111- if (receiver .getLocation ().getBlock () != null )
112- Bukkit .getServer ().getPluginManager ().callEvent (
113- new BlockRedstoneEvent (receiver .getLocation ().getBlock ().getRelative (blockFace ),
114- receiver .getLocation ().getBlock ().getRelative (blockFace ).getBlockPower (), 0 ));
110+ try {
111+ if (receiver .getLocation () != null ) {
112+ if (receiver .getLocation ().getBlock () != null )
113+ Bukkit .getServer ().getPluginManager ().callEvent (
114+ new BlockRedstoneEvent (receiver .getLocation ().getBlock ().getRelative (blockFace ),
115+ receiver .getLocation ().getBlock ().getRelative (blockFace ).getBlockPower (), 0 ));
116+ }
117+ } catch (NullPointerException ignored ) {
115118 }
116119 }
117120 }
@@ -122,7 +125,7 @@ public void turnOff() {
122125 }
123126 } catch (RuntimeException e ) {
124127 WirelessRedstone .getWRLogger ()
125- .severe ("Error while updating redstone onBlockRedstoneChange for Screens , turn on the Debug Mode to get more informations." );
128+ .severe ("Error while updating redstone onBlockRedstoneChange for receivers/screens , turn on the Debug Mode to get more informations." );
126129
127130 if (ConfigManager .getConfig ().getDebugMode ())
128131 e .printStackTrace ();
0 commit comments