Civcraft / PrisonPearl

Minecraft plugin for civcraft which allows players to imprison other players inside ender pearls
BSD 3-Clause "New" or "Revised" License
4 stars 16 forks source link

NameLayer existence check throws NPE if NameLayer isn't being used #5

Closed erocs closed 10 years ago

erocs commented 10 years ago

https://github.com/Civcraft/PrisonPearl/blob/master/src/com/untamedears/PrisonPearl/PrisonPearlPlugin.java#L86

[19:11:41 ERROR]: Error occurred while enabling PrisonPearl v2.0.6 (Is it up to date?) java.lang.NullPointerException at com.untamedears.PrisonPearl.PrisonPearlPlugin.onEnable(PrisonPearlPlugin.java:86) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) ~[spigot-1.7.10.R4.CivCraft.0003.jar:git-Spigot-1.7.9-R0.2-203-g02dec9b]

rourke750 commented 10 years ago

fixed

erocs commented 10 years ago

https://github.com/Civcraft/PrisonPearl/blob/master/src/com/untamedears/PrisonPearl/PrisonPearlStorage.java#L49

https://github.com/Civcraft/PrisonPearl/blob/master/src/com/untamedears/PrisonPearl/PrisonPearlCommands.java#L36

There is Bukkit.getPluginManager().isPluginEnabled for checking if a plugin exists.

rourke750 commented 10 years ago

https://github.com/Civcraft/PrisonPearl/commit/1d0a0cde787ebddd69d52a5f8294723db3fe7732

erocs commented 10 years ago

Make sure to catch both instances. ;)

rourke750 commented 10 years ago

lol I did it in eclipse but didnt save the files.