Neruina - Ticking Entity Fixer

Neruina - Ticking Entity Fixer

19M Downloads

When an entity throws an error, and that error message is null Neurina crashes and instantly closes minecraft

Tilation opened this issue ยท 4 comments

commented

When an entity throws an error and the mod tries to write the nbt data and get the error message, if the error is null, minecraft instantly closes, no null checking before getting the error details.

Referenced lines: https://github.com/Bawnorton/Neruina/blob/stonecutter/src/main/java/com/bawnorton/neruina/util/TickingEntry.java#L193-L232

commented

Hmm, the error should never be null as it's what is caught

commented

Maybe I misunderstood the crash log, this is the stack trace of the crash:

[00:57:21] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.NullPointerException: Cannot invoke "String.isEmpty()" because "p_129298_" is null
	at net.minecraft.nbt.StringTag.m_129297_(StringTag.java:57) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.nbt.CompoundTag.m_128359_(CompoundTag.java:199) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at com.bawnorton.neruina.util.TickingEntry.writeStackTraceNbt(TickingEntry.java:195) ~[Neruina-2.1.1-forge+1.19.2.jar%23724!/:?]
	at com.bawnorton.neruina.util.TickingEntry.writeNbt(TickingEntry.java:187) ~[Neruina-2.1.1-forge+1.19.2.jar%23724!/:?]
	at com.bawnorton.neruina.handler.PersitanceHandler.lambda$writeNbtInternal$0(PersitanceHandler.java:83) ~[Neruina-2.1.1-forge+1.19.2.jar%23724!/:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
	at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1787) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
	at com.bawnorton.neruina.handler.PersitanceHandler.writeNbtInternal(PersitanceHandler.java:83) ~[Neruina-2.1.1-forge+1.19.2.jar%23724!/:?]
	at com.bawnorton.neruina.handler.PersitanceHandler.m_7176_(PersitanceHandler.java:73) ~[Neruina-2.1.1-forge+1.19.2.jar%23724!/:?]
	at net.minecraft.world.level.saveddata.SavedData.m_77757_(SavedData.java:36) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.world.level.storage.DimensionDataStorage.m_164865_(DimensionDataStorage.java:161) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at java.util.HashMap.forEach(HashMap.java:1429) ~[?:?]
	at net.minecraft.world.level.storage.DimensionDataStorage.m_78151_(DimensionDataStorage.java:159) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.server.level.ServerLevel.m_8806_(ServerLevel.java:723) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.server.level.ServerLevel.m_8643_(ServerLevel.java:702) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.server.MinecraftServer.m_129885_(MinecraftServer.java:496) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.server.MinecraftServer.m_195514_(MinecraftServer.java:521) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:832) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.client.server.IntegratedServer.m_5705_(IntegratedServer.java:84) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[client-1.19.2-20220805.130853-srg.jar%23830!/:?]
	at java.lang.Thread.run(Thread.java:1583) [?:?]
commented

ok I see, its not the error being null its the message of the error being null and nbt being unable to encode null