mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2024-11-22 11:55:12 +01:00
add null checks
This commit is contained in:
parent
50ddae0157
commit
514afb3f0d
@ -177,9 +177,15 @@ public class ExpiredMenu extends Holder {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
player.getInventory().addItem(Methods.fromBase64(data.getString("OutOfTime/Cancelled." + i + ".Item")));
|
final ItemStack yoink = Methods.fromBase64(data.getString("OutOfTime/Cancelled." + i + ".Item", ""));
|
||||||
|
|
||||||
|
if (yoink != null) {
|
||||||
|
player.getInventory().addItem(yoink);
|
||||||
|
|
||||||
data.set("OutOfTime/Cancelled." + i, null);
|
data.set("OutOfTime/Cancelled." + i, null);
|
||||||
|
} else {
|
||||||
|
this.plugin.getLogger().warning("The player " + player.getName() + " tried to redeem an invalid item in the expired menu.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -225,7 +231,10 @@ public class ExpiredMenu extends Holder {
|
|||||||
|
|
||||||
player.sendMessage(Messages.GOT_ITEM_BACK.getMessage(player));
|
player.sendMessage(Messages.GOT_ITEM_BACK.getMessage(player));
|
||||||
|
|
||||||
player.getInventory().addItem(Methods.fromBase64(auction.getString("Item")));
|
final ItemStack yoink = Methods.fromBase64(auction.getString("Item"));
|
||||||
|
|
||||||
|
if (yoink != null) {
|
||||||
|
player.getInventory().addItem(yoink);
|
||||||
|
|
||||||
data.set("OutOfTime/Cancelled." + key, null);
|
data.set("OutOfTime/Cancelled." + key, null);
|
||||||
|
|
||||||
@ -234,6 +243,9 @@ public class ExpiredMenu extends Holder {
|
|||||||
menu.click(player);
|
menu.click(player);
|
||||||
|
|
||||||
GuiManager.openPlayersExpiredList(player, 1);
|
GuiManager.openPlayersExpiredList(player, 1);
|
||||||
|
} else {
|
||||||
|
this.plugin.getLogger().warning("The player " + player.getName() + " tried to redeem an invalid item in the expired menu.");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user