Universal Mod Core

Universal Mod Core

2M Downloads

Random crash on startup deserializing CustomItem

DevonFrosch opened this issue ยท 3 comments

commented

Hello,

I just got a crash on startup (while loading mods) with the following NullPointerException:

java.lang.NullPointerException
    at cam72cam.mod.serialization.TagSerializer.deserialize(TagSerializer.java:146)
    at cam72cam.mod.serialization.TagSerializer.deserialize(TagSerializer.java:139)
    at cam72cam.mod.item.CustomItem$ItemDataSerializer.<init>(CustomItem.java:159)
    at cam72cam.immersiverailroading.items.ItemCastRail$Data.<init>(ItemCastRail.java:40)
    at cam72cam.immersiverailroading.items.ItemCastRail.getTooltip(ItemCastRail.java:32)
    at cam72cam.mod.item.CustomItem$ItemInternal.func_77624_a(CustomItem.java:115)
    at net.minecraft.item.ItemStack.func_82840_a(ItemStack.java:707)
    at net.minecraft.client.Minecraft.lambda$populateSearchTreeManager$1(Minecraft.java:576)
    at net.minecraft.client.Minecraft$$Lambda$1579/263741256.apply(Unknown Source)
    at net.minecraft.client.util.SearchTree.func_194042_b(SourceFile:49)
    at net.minecraft.client.util.SearchTree.func_194043_a(SourceFile:44)
    at net.minecraft.client.Minecraft$$Lambda$1604/562720557.accept(Unknown Source)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at net.minecraft.client.Minecraft.func_193986_ar(Minecraft.java:590)
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:529)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:3931)
    at net.minecraft.client.main.Main.main(SourceFile:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

Crash log: crash-2022-10-05_12.32.53-client.txt

I know this happens from time to time with other players on our modpack, but only occasionally and never persistent. I could not figure out any other circumstances leading to that crash. For all I know it might also be a bug in ImmersiveRailroading or one of our packs... If you neeed anything else (like the full logs) I'm happy to supply them.

I've looked a the code for an hour now and I can't see why anything could be null that isn't supposed to be. Perhaps you have the better eye for it (or can at least put in some handling to pass additional information to the crash).

Thanks,
DevonFrosch

commented

Downgrade to java 8

commented

I am working on Java 8 already (see crash report), but for some reason with Build 8u51... that might be the issue. Thanks :-)

commented

For those reading here, using the TechnicLauncher and having the same problem (with Minecraft 1.12.2): Mojang has a version of java they prefer, and for Minecraft 1.12.2 this seems to be stuck at Java 8u51 (from 2015). TechnicLauncher uses this version unless you disable it with Launcher Options > Java settings > Use Mojang Java runtimes per launcher.

The issue above might as well be a bug from the old Java version.