PreciousStones

PreciousStones

269k Downloads

Rightclick confirm on /ps changeowner causes null key insertion. Leads to NPE.

Opened this issue ยท 2 comments

commented

In PSPlayerListener.OnPlayerInteract(*), line 1306

field.changeOwner();

plugin.getStorageManager().offerPlayer(field.getOwner());
plugin.getStorageManager().offerPlayer(field.getNewOwner());

After executing field.changeOwner(), the field's newOwner variable is set to null, causing it to, further down the line, insert a null playerstring. This leads to a NPE when attempting to save. Suggest replacing field.getNewOwner() with oldOwnerName, since the owner at point of execution is already the new owner.

R: 9.5.5 for CB 1.4.7-R0.1 Jan 28, 2013

commented

Another great catch, thank you! Gave you pull/push perms in case you find another bug so you don't have to wait for me to fix.

commented

Thanks for the permissions but I was just doing this because a server administrator was having issues. I have no further interest in maintaining this plugin as I don't use it personally. All depends on if I get asked for more help or new features.