Project Zomboid

Project Zomboid

48 ratings
Never Add Null Items
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
525.895 KB
21 Jun, 2024 @ 12:29pm
1 Change Note ( view )

Subscribe to download
Never Add Null Items

Description
Music for the End of the World - Error Fix

Overview
This mod fixes an occasional error thrown while exploring new areas of the map, where calls to AddItem or addItemOnServer that do not provide an item will throw Javaside errors in vanilla PZ-- this simply returns nil back to Lua in the case where nil is provided instead of an item. Originally designed for the Music for the End of the World mod, this fix can address similar errors in other mods.


Support and Feedback
For issues or feedback, please leave a comment below.

Code by Burryaga, lovingly maintained by theharber.

Now go subscribe to Burryaga's "Act Undead" and roleplay as Shaun of the Dead, or The Whisperers.

Workshop ID: 3272418356
Mod ID: NeverAddNullItem
15 Comments
Burryaga 6 Aug @ 7:26pm 
@yashoku Order doesn't matter. It's extremely unlikely any other mod could prevent this mod from behaving properly. Loading last would be safest in theory but the odds that it would ever matter in practice are near zero.

@Kenpa This mod is very light and it does not seem possible to me that it could be related to your issue at all.
Burryaga 6 Aug @ 7:18pm 
@Ryan Yes.

@Laypeople Sometimes, mods run code that attempts to add an item to a game container, like a crate. In rare cases, the variable that they intend to reference the item they mean to add is not properly formed. Instead of being the item, the variable will be undefined, i.e., null. Adding null to a container in Project Zomboid will throw a "red box error" or "red number error" (generating a stack trace and a red number in a box on the screen). But in a running server, this is generally not necessary, because all that happens is nothing gets added to the container. This mod just stops the game from attempting to add null to a container so that no error is thrown under those conditions at all.
Ryan 11 Oct, 2024 @ 8:16am 
does this work?
Kenpa 4 Sep, 2024 @ 5:58pm 
I have zero coding ability but it sounds like this may help those little errors with NULL references I see. May new problem is why I'm on the Workshop today, all day. Feel free to ignore because it may be completely unrelated to what this mod does, but there's a chance someone recognizes the symptoms...

The game ran as normal until I turned Steam Online Mode again, and the updates came flooding in. Now I get a 1-2 second lag spikes, like it's on a timed pattern every 5-6 seconds. It also happens when moving/turning, but even if I sit and do nothing the timely lag happens.

All I did was start a save that was doing just fine (other than performance reducing over time but nvm that). Anyhow, maybe someone recognizes that timed lag spike behavior. It happens if I sit and do absolutely nothing.

Again, feel free to ignore. I know this isn't a bug forum. It just looks like the right type of people may come by here. Thanks for the mod that may fix those NULL errors. o7
yashoku.shade 23 Jul, 2024 @ 12:22pm 
Should this mod be placed at the beginning of your mod order or at the end? Currently resolving freezing issues and have turned this on and off several times trying to figure out if its helping or not and where it should go.
theharber  [author] 24 Jun, 2024 @ 1:08pm 
@Lazarus, you betcha!
Lazarus 24 Jun, 2024 @ 7:43am 
can this be used on a dedicated server and/or multiplayer?
theharber  [author] 23 Jun, 2024 @ 2:17pm 
@Gabriel Calamity, thanks for your explanation! Those who know, know .

@Krilton, I wouldn't be surprised! While it was originally designed to resolve the issue stemming from the MftEofW mod, it fixes the same error occurring regardless which mod would have caused the issue.
Krilton 23 Jun, 2024 @ 2:02pm 
this then could resolve my problem although i've put PZ on the backburner for now.
The Lamb 23 Jun, 2024 @ 12:59pm 
Like the freeze don't last long, but its unexpected, never know how much it gonna last, then, it comes back, and you crash because ou looked to the side to drink some water, even though i drive at 50 miles.