Gollorum / Signpost

minecraft forge signpost mod
15 stars 11 forks source link

[NPE] raised at BasePost.java:51 during interaction with a waystone. Suggested root cause: null name #29

Closed 0424242 closed 6 years ago

0424242 commented 7 years ago

stacktrace:

[00:03:04] [Server thread/ERROR]: SimpleChannelHandlerWrapper exception
io.netty.handler.codec.EncoderException: java.lang.NullPointerException
    at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:107) ~[MessageToMessageEncoder.class:4.0.23.Final]
    at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[MessageToMessageCodec.class:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:706) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
    at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:741) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
    at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:895) ~[DefaultChannelPipeline.class:4.0.23.Final]
    at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:240) ~[AbstractChannel.class:4.0.23.Final]
    at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendTo(SimpleNetworkWrapper.java:254) [SimpleNetworkWrapper.class:?]
    at gollorum.signpost.blocks.BasePost.func_180639_a(BasePost.java:51) [BasePost.class:?]
    at net.minecraft.server.management.PlayerInteractionManager.func_187251_a(PlayerInteractionManager.java:448) [lz.class:?]
    at net.minecraft.network.NetHandlerPlayServer.func_184337_a(NetHandlerPlayServer.java:685) [mi.class:?]
    at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:55) [jm.class:?]
    at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:11) [jm.class:?]
    at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [fo$1.class:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_25]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_25]
    at net.minecraft.util.Util.func_181617_a(SourceFile:46) [h.class:?]
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:679) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624) [MinecraftServer.class:?]
    at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:240) [cch.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
Caused by: java.lang.NullPointerException
    at net.minecraftforge.fml.common.network.ByteBufUtils.writeUTF8String(ByteBufUtils.java:153) ~[ByteBufUtils.class:?]
    at gollorum.signpost.network.messages.ChatMessage.toBytes(ChatMessage.java:38) ~[ChatMessage.class:?]
    at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.encodeInto(SimpleIndexedCodec.java:30) ~[SimpleIndexedCodec.class:?]
    at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.encodeInto(SimpleIndexedCodec.java:26) ~[SimpleIndexedCodec.class:?]
    at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.encode(FMLIndexedMessageToMessageCodec.java:73) ~[FMLIndexedMessageToMessageCodec.class:?]
    at io.netty.handler.codec.MessageToMessageCodec$1.encode(MessageToMessageCodec.java:67) ~[MessageToMessageCodec$1.class:4.0.23.Final]
    at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:89) ~[MessageToMessageEncoder.class:4.0.23.Final]
    ... 22 more

Check this out:

[00:03:43] [Server thread/INFO]: [STDOUT]: SweetHome
[00:03:43] [Server thread/INFO]: [STDOUT]: Waystone 1
[00:03:43] [Server thread/INFO]: [STDOUT]: cow1
[00:03:43] [Server thread/INFO]: [STDOUT]: Sweet Home
[00:03:43] [Server thread/INFO]: [STDOUT]: Village 1
[00:03:43] [Server thread/INFO]: [STDOUT]: null
[00:03:43] [Server thread/INFO]: [STDOUT]: ice2
[00:03:43] [Server thread/INFO]: [STDOUT]: ice1
[00:03:43] [Server thread/INFO]: [STDOUT]: vlg1
[00:03:43] [Server thread/INFO]: [STDOUT]: ICE 2
[00:03:43] [Server thread/INFO]: [STDOUT]: ice3
[00:03:43] [Server thread/INFO]: [STDOUT]: Desert Ice 1
[00:03:43] [Server thread/INFO]: [STDOUT]: home1

I bet having that null is the rootcause.

0424242 commented 7 years ago

Full log: log.txt

0424242 commented 7 years ago

Issue rises when a new waystone placed. Result: server shutdown After result: all info about achivements and existing waypoints is lost.

Gollorum commented 6 years ago

The new version should fix this