DenisD3D / Mc2Discord

Link your Minecraft server chat with your Discord (75k downloads)
https://modrinth.com/mod/mc2discord
Apache License 2.0
43 stars 11 forks source link

Server Crash on world load #92

Closed Medatur76 closed 1 year ago

Medatur76 commented 1 year ago

Describe the bug

I just downloaded the fabric version of the mod and put it into my modded server and got this error java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "value" is null at fr.denisd3d.mc2discord.shadow.ml.denisd3d.config4j.Config4J.mapField(Config4J.java:107) ~[mc2discord-fabric-1.20.x-4.1.0.jar:?] I tested it on a fresh server as well but got the same error.

Minecraft 1.20.1 Fabric Loader Server Version 0.14.22 Mc2Discord Version [Fabric 1.20.x] 4.1.0 Fabric API (I tried 2 versions) 0.86.0+1.20.1 and 0.87.0+1.20.1

Your config file

don't have one, the server crashes to fast

Medatur76 commented 1 year ago

Just incase this helps , I think this is the problematic line: Field[] var4 = value.getClass().getDeclaredFields(); Its in the mapField function called here: this.mapField(this.config, "", this); in the save function in the Config4J class. In this line this.mapField(this.config, "", this); the this in the third parm slot is null. (I think)

DenisD3D commented 1 year ago

Will look into it tomorow Thanks for reporting

DenisD3D commented 1 year ago

Issue should be fixed with latest version: https://modrinth.com/mod/mc2discord/version/Gzc2VNGK