From 3c0ea24ac6fc8f6b512876da7ea2f0d6bd03da0f Mon Sep 17 00:00:00 2001 From: Kiran Hart Date: Thu, 22 Sep 2022 21:40:23 -0400 Subject: [PATCH] if player is null during getSellLimit, return max val Took 15 seconds --- .../java/ca/tweetzy/auctionhouse/auction/AuctionPlayer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/ca/tweetzy/auctionhouse/auction/AuctionPlayer.java b/src/main/java/ca/tweetzy/auctionhouse/auction/AuctionPlayer.java index cc4d2b4..fc01d04 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/auction/AuctionPlayer.java +++ b/src/main/java/ca/tweetzy/auctionhouse/auction/AuctionPlayer.java @@ -89,6 +89,10 @@ public class AuctionPlayer { public int getSellLimit() { + // fall back + if (player == null) + return Integer.MAX_VALUE; + if (player.hasPermission("auctionhouse.maxsell.*")) return Integer.MAX_VALUE; for (int i = 1001; i > 0; i--) { if (player.hasPermission("auctionhouse.maxsell." + i)) return i;