Vault

Vault

7M Downloads

A NullPointerException from Vault...

Variadicism-zz opened this issue ยท 1 comments

commented

Hi. I'm REALDrummer, the author of myUltraWarps, a warping plugin on Bukkit. I decided to allow users to customize certain settings such as the maximum number of warps players are allowed to use for permissions-based groups of users. However, I have set up permissions as described on the BukkitDev page, but when I try to use the method getGroups(), it gives me a NullPointerException that originates not from my plugin, but from Vault. The last few days, I've attempted every conceivable method to resolve the problem other than modifying Vault's code and I have not been able to solve the problem. Here is the full stack trace from the server logs. This stack trace is from attempting to disable the plugin by stopping the server. A similar error occurs upon startup as well.

[SEVERE] Error occurred while disabling myUltraWarps v4 (Is it up to date?)
java.lang.NullPointerException
at net.milkbowl.vault.permission.plugins.Permission_PermissionsBukkit.getGroups(Permission_PermissionsBukkit.java:237)
at REALDrummer.myUltraWarps.saveTheConfig(myUltraWarps.java:1536)
at REALDrummer.myUltraWarps.onDisable(myUltraWarps.java:88)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:363)
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:400)
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:393)
at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:251)
at net.minecraft.server.MinecraftServer.stop(MinecraftServer.java:409)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:489)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)

I have looked at line 237 of the Permission_PermissionsBukkit.class myself and I cannot determine the problem. My best guess is that Vault is somehow arriving at the conclusion that "perms" is null or that perms.getGroups() returns null, but that's all I can figure. Thanks for helping with this problem. I appreciate it.

commented

Uh, if this only happens during the disable then there's not really anything I can debug. Data is released in an unknown order when the server is disabled so there's no way to tell what is going on, and no way to really fix the issue. You should expect that there is no possible way to be sure that a reference in another plugin will be good when your plugin is disabled. so never try accessing data in other plugins at that time.

If the reference works while the server is on, then you know it's because Bukkit is clearing out the permission plugin before your plugin.