Avoid NPE in SignListener when requesting a vault. Fixes #187

This commit is contained in:
kashike
2016-06-21 17:25:08 -07:00
parent 76475093c8
commit a700fea5a2
@@ -94,7 +94,9 @@ public class SignListener implements Listener {
// We already checked that they can use signs, now lets check if they have this many vaults. // We already checked that they can use signs, now lets check if they have this many vaults.
if (VaultOperations.checkPerms(player, num)) { if (VaultOperations.checkPerms(player, num)) {
Inventory inv = UUIDVaultManager.getInstance().loadOwnVault(player, num, VaultOperations.getMaxVaultSize(player)); Inventory inv = UUIDVaultManager.getInstance().loadOwnVault(player, num, VaultOperations.getMaxVaultSize(player));
if (inv != null) {
player.openInventory(inv); player.openInventory(inv);
}
} else { } else {
player.sendMessage(Lang.TITLE.toString() + Lang.NO_PERMS.toString()); player.sendMessage(Lang.TITLE.toString() + Lang.NO_PERMS.toString());
return; // Otherwise it would try to add vault view info down there. return; // Otherwise it would try to add vault view info down there.