Project Zomboid

Project Zomboid

[B42/B41] Bandits NPC (v2)
[BUG REPORT] Crash when Unbarricading (NullPointerException)
First of all, thank you for your excellent work on the "Bandits" mod! It adds a fantastic dynamic to the game.

I'm writing to report a critical bug that is causing a crash to desktop (CTD).

Problem Description:
The error consistently occurs whenever a barricade is removed (either by the player or an NPC), via the mod's Unbarricade function.

Game Version:
I am using Project Zomboid version B42.9.

Error Log:
Here are the error logs that appear in the console at the moment of the crash:

[LOG 1 - LUA ERROR] Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@6c6280a0 function: Unbarricade -- file: BanditServerCommands.lua line # 92 | MOD: Bandits function: onClientCommand -- file: BanditServerCommands.lua line # 244 | MOD: Bandits
[LOG 2 - JAVA EXCEPTION] java.lang.reflect.InvocationTargetException [...] Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Class.getDeclaredConstructor(java.lang.Class[])" because "<parameter2>.handler" is null at zombie.network.packets.INetworkPacket.getPacket(INetworkPacket.java:186) at zombie.iso.IsoObject.sendObjectChange(IsoObject.java:5585) ... 24 more

Analysis:
From the logs, it appears to be a compatibility issue between the Unbarricade function and the current game version. The call to sendObjectChange is resulting in a NullPointerException, likely because the game's API for that function was changed in a recent update.

I hope this detailed report is helpful for you to track down and fix the issue.
Thanks again for your time and dedication