Another NPE

NPE thrown when trying to cancel an Auction.
This commit is contained in:
TrueDarkLord 2024-12-13 10:58:13 -07:00
parent 40cbb4574f
commit 5f6b5fe7c1
No known key found for this signature in database
GPG Key ID: 02AA15A3B1FAFE4F

View File

@ -1016,13 +1016,13 @@ public class GuiListener implements Listener {
sellerPlayer.sendMessage(Messages.ADMIN_FORCE_CANCELLED_TO_PLAYER.getMessage(player)); sellerPlayer.sendMessage(Messages.ADMIN_FORCE_CANCELLED_TO_PLAYER.getMessage(player));
} }
AuctionCancelledEvent event = new AuctionCancelledEvent((sellerPlayer != null ? sellerPlayer : Methods.getOfflinePlayer(seller)), Methods.fromBase64(data.getString("Items." + ID + ".Item")), Reasons.ADMIN_FORCE_CANCEL); AuctionCancelledEvent event = new AuctionCancelledEvent((sellerPlayer != null ? sellerPlayer : Methods.getOfflinePlayer(seller)), Methods.fromBase64(data.getString("Items." + i + ".Item")), Reasons.ADMIN_FORCE_CANCEL);
plugin.getServer().getPluginManager().callEvent(event); plugin.getServer().getPluginManager().callEvent(event);
data.set("OutOfTime/Cancelled." + num + ".Seller", data.getString("Items." + i + ".Seller")); data.set("OutOfTime/Cancelled." + num + ".Seller", data.getString("Items." + i + ".Seller"));
data.set("OutOfTime/Cancelled." + num + ".Full-Time", data.getLong("Items." + i + ".Full-Time")); data.set("OutOfTime/Cancelled." + num + ".Full-Time", data.getLong("Items." + i + ".Full-Time"));
data.set("OutOfTime/Cancelled." + num + ".StoreID", data.getInt("Items." + i + ".StoreID")); data.set("OutOfTime/Cancelled." + num + ".StoreID", data.getInt("Items." + i + ".StoreID"));
data.set("OutOfTime/Cancelled." + num + ".Item", data.getString("Items." + ID + ".Item")); data.set("OutOfTime/Cancelled." + num + ".Item", data.getString("Items." + i + ".Item"));
data.set("Items." + i, null); data.set("Items." + i, null);
Files.data.save(); Files.data.save();