Try to fix npe in gui Bank Selector

This commit is contained in:
Fabrizio La Rosa 2020-08-01 18:18:59 +02:00
parent e45296251c
commit 3fabd75aab

View File

@ -141,7 +141,11 @@ public class GuiBankSelector extends Gui {
double amount; double amount;
try { try {
amount = Double.parseDouble(gui.getInputText().trim()); if(gui.getInputText() != null) {
amount = Double.parseDouble(gui.getInputText().trim());
} else {
amount = 0;
}
} catch (NumberFormatException e1) { } catch (NumberFormatException e1) {
messageManager.sendMessage(e.player, languageLoad.getString("Command.Island.Bank.Short4.Message")); messageManager.sendMessage(e.player, languageLoad.getString("Command.Island.Bank.Short4.Message"));
soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f); soundManager.playSound(event.player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1f, 1f);