Insufficient null checks
timothyekl opened this issue ยท 10 comments
OpenWarp fails frequently in Warp#getConfigurationMap()
with an NPE. No currently known cause.
Cannot yet reproduce; anyone encountering this issue, please comment with steps to repro (@fernferret, @KaneHart, @nvx).
Really nasty bug. Only got it after this was posted too haha. I rebooted the server /warp trade and /sethome and bang. Happens none stop now.
I rebooted now it's happening the second we reboot and use the /sethome command. My /sethome is now perm broken <3
Current thoughts: this bug may be triggered when a server with multiple players has cause to save all OpenWarp configs. The Location in the home warp for non-logged-in players may have a null
world if that location or world is not loaded, causing an NPE during player configuration map generation and save (currently Warp.java
line 90).
This issue is now caught and emits a WARNING
-level log message.
Ugh silly github spamming unrelated things.
On topic however, setup a server with a world called "world", then create an additional world called "cleanroom", shut down the server, and replace OpenWarp/warps.yml with contents of: http://pastie.org/pastes/2386193/text
Start the server up, then stop it again (I had logged in and done a /warp shop in-between, but from what I can tell it shouldn't affect it). Observe the warning level message being emitted, as well as your warps.yml getting munged.
@nvx: Just reproduced successfully. Can you confirm that the new contents of warps.yml
is an empty dictionary for the only key (warps: {}
)?
Actually, mine sometimes was an empty dictionary, and other times was just a single warp - water I think, but yeah - close enough approximation, fix the one you can reproduce and the other will probably get fixed along with it, else I'll report back if it still happens :)
@nvx can still reproduce. Reopening.