Closed NullCase closed 5 years ago
getPlayerData never returns null, so I'm not sure how the claim would be null... I'll add some debug statements here...
Well, it seems like this won't be right. Just a guess.
Admin claimed land often has Owner: ''
So no UUID listed under owner.
So I checked one of the claims which has an auction. It's been transferred to Admin Claim with no owner listed. Here's what the file data says.
Useless info?
Lesser Boundary Corner: world;-156;54;-13
Greater Boundary Corner: world;-147;58;-5
Owner: ''
Builders: []
Containers: []
Accessors: []
Managers: []
Parent Claim ID: -1
inheritNothing: false
in any case, I can test again tomorrow.
I'll have to double check how GP stores admin claims. I know it's exposed in code as null
but if it were to store it as null
in file, the key owner
wouldn't exist either. So I guess it stores it as an empty string which you state is what usually happens so yea, that info doesn't help.
Just updated and an auction ended on server restart. Here's the console messages. It looks pretty good.
19.03 13:39:59 [Server] INFO [GPAuctions] Auction Claim ID: 2983 endTime: 1552929154524 startingBid: 999.0 ended.
19.03 13:39:59 [Server] INFO [GPAuctions] me.ryanhamshire.GriefPrevention.PlayerData@210bb35d,me.ryanhamshire.GriefPrevention.Claim@64e52eee
19.03 13:39:59 [Server] INFO [GPAuctions] No winner, returning to owner ac3b0963-75bd-44d2-b6ad-12efa76985cc
19.03 13:39:59 [Server] INFO [GPAuctions] Auction Claim ID: 2984 endTime: 1552929994112 startingBid: 1200.0 ended.
19.03 13:39:59 [Server] INFO [GPAuctions] me.ryanhamshire.GriefPrevention.PlayerData@210bb35d,me.ryanhamshire.GriefPrevention.Claim@32da53ec
19.03 13:39:59 [Server] INFO [GPAuctions] No winner, returning to owner ac3b0963-75bd-44d2-b6ad-12efa76985cc
What if a sign were removed during the auction and then the auction closed on schedule?
If the sign were removed I think a different error would appear. That being said GPAuctions doesn't expect the sign to be moved since it stores and uses the sign location.
Only thing I could think of that would cause this NPE is if the claim was abandoned/deleted before the auction ends (NPE being triggered on call to claim#getArea when refunding claimblocks to original claim owner).
I'll try to reproduce this at next release by testing out the scenarios. Abandoning the claim, moving it around, removing the sign before auction closes (though as you say it might just produce a different error).
Oh! you've already released the next one. OK. I'll test tomorrow.
Test: Create auction, abandon the admin claim, wait for it to end.
Result:
21.03 12:26:34 [Server] INFO [GPAuctions] Auction Claim ID: 2995 endTime: 1553185550274 startingBid: 2000.0 ended.
21.03 12:26:34 [Server] INFO [GPAuctions] me.ryanhamshire.GriefPrevention.PlayerData@7616976d,null
21.03 12:26:34 [Server] WARN [GPAuctions] Task #49 for GPAuctions v1.1 commit 2a44d20 generated an exception
21.03 12:26:34 [Server] INFO java.lang.NullPointerException: null
21.03 12:26:34 [Server] INFO at com.robomwm.gpauctions.auction.Auctioneer.endAuction(Auctioneer.java:190) ~[?:?]
21.03 12:26:34 [Server] INFO at com.robomwm.gpauctions.auction.Auctioneer.access$100(Auctioneer.java:33) ~[?:?]
21.03 12:26:34 [Server] INFO at com.robomwm.gpauctions.auction.Auctioneer$1.run(Auctioneer.java:70) ~[?:?]
21.03 12:26:34 [Server] INFO at org.bukkit.craftbukkit.v1_13_R2.scheduler.CraftTask.run(CraftTask.java:82) ~[patched_1.13.2.jar:git-Paper-566]
21.03 12:26:34 [Server] INFO at org.bukkit.craftbukkit.v1_13_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:449) ~[patched_1.13.2.jar:git-Paper-566]
21.03 12:26:34 [Server] INFO at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:1003) ~[patched_1.13.2.jar:git-Paper-566]
21.03 12:26:34 [Server] INFO at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:439) ~[patched_1.13.2.jar:git-Paper-566]
21.03 12:26:34 [Server] INFO at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:938) ~[patched_1.13.2.jar:git-Paper-566]
21.03 12:26:34 [Server] INFO at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:836) ~[patched_1.13.2.jar:git-Paper-566]
21.03 12:26:34 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
It looks like that's what happened. ^^^
What do you think?
If that is indeed what's happening (it seems like you'll know for sure), how do you want to address this?
Do you think it will be a problem to simply cancel the auction?
For example: Auction ends, but the claim was somehow abandoned... at that point the plugin cancels the auction as if /gpacancel were used.
Yea that sounds like a good resolution. I was under the assumption that since they're admin-claimed, nothing would happen to the claim until auction is ended or claimed.