bergerhealer / BKCommonLib

An extensive library used in bergerhealer's plugins
Other
181 stars 45 forks source link

NullPointerException #140

Closed Felixx61 closed 2 years ago

Felixx61 commented 2 years ago
BkCommonLib version: v1.18.1-v3-1254
Spigot version: paper 1.18.1 build 215
[19:55:00 WARN]: [BKCommonLib] Task #18 for BKCommonLib v1.18.1-v3 generated an exception
java.lang.NullPointerException: Cannot assign field "prev" because "next" is null
        at com.bergerkiller.bukkit.common.collections.SortedIdentityCache$LinkEntry.bind(SortedIdentityCache.java:336) ~[BKCommonLib-1.18.1-v3-1254.jar:?]
        at com.bergerkiller.bukkit.common.collections.SortedIdentityCache$Syncher.accept(SortedIdentityCache.java:276) ~[BKCommonLib-1.18.1-v3-1254.jar:?]
        at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
        at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1092) ~[?:?]
        at com.bergerkiller.bukkit.common.collections.SortedIdentityCache.sync(SortedIdentityCache.java:140) ~[BKCommonLib-1.18.1-v3-1254.jar:?]
        at com.bergerkiller.bukkit.common.internal.map.MapDisplayHeldMapUpdater.run(MapDisplayHeldMapUpdater.java:30) ~[BKCommonLib-1.18.1-v3-1254.jar:?]
        at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.18.1.jar:git-Paper-215]
        at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[paper-1.18.1.jar:git-Paper-215]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1557) ~[paper-1.18.1.jar:git-Paper-215]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:480) ~[paper-1.18.1.jar:git-Paper-215]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1480) ~[paper-1.18.1.jar:git-Paper-215]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1273) ~[paper-1.18.1.jar:git-Paper-215]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-215]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[19:55:00 WARN]: [BKCommonLib] Task #18 for BKCommonLib v1.18.1-v3 generated an exception
java.lang.NullPointerException: null

Problem or bug: NullPointerException

Expected behaviour:

Steps to reproduce: tbh not sure, just notice it fires on production server throughout the day

Thank you!

bergerkiller commented 2 years ago

Aw I thought the sorted identity cache had enough testing, guess not. I'll try to fix this

bergerkiller commented 2 years ago

After a bunch of brute-forcing Ive managed to repro your issue in a test. I then found & fixed the bug that caused it.

https://ci.mg-dev.eu/job/BKCommonLib/1255/

Felixx61 commented 2 years ago

I love you, ty