desht / ModularRouters

A Forge Mod for item routers with pluggable modules
16 stars 20 forks source link

Unowned player modules cause a NullPointerException #215

Closed mazunki closed 5 months ago

mazunki commented 5 months ago

Describe the bug

As soon as a router with a player module without an owner is loaded, the server crashes immediately, throwing this error: Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.ref.WeakReference.get()" because "this.playerRef" is null

How to reproduce the bug

I am not exactly sure why the module has no player reference in it, but I was unable to log back into the world without rolling back.

This player module was autocrafted with AE2. I am currently running ATM9 0.2.39, just updated from 0.2.34.

Expected behavior

The router would simply not do the player operation, perhaps with a warning when hovering the player module saying it has no player module.

Additional details

It would be nice if I could disable routers from the server cli by doing something like /modularrouters disableAll or /modularrouters disable playerModules, so I could fix it without rolling back the chunk the corrupted module is in.

Which Minecraft version are you using?

1.20

Crash log

https://clip.mazunki.tech/modularrouterlog

desht commented 5 months ago

Fixed in 12.1.1