Jump to content

NRE

Closed 1.4.6 1.4.7

monsterqueen
monsterqueen

Posted (edited)

This error happens during startup generation causing .sav file corruption due to missing null checks in the SleepingBag harmony patch. Full explanation, a player died during generation, which sent a call to waterbases, which nred because the player wasn't online, which sent a call to spawn points, which checked the player sleeping bag, then the config which wasn't initialized because it was during save file restoration causing the nre and interruption to the boot process.


NullReferenceException: Object reference not set to an instance of an object
  at Oxide.Plugins.SpawnPoints+Patch_1.Prefix (SleepingBag __instance, SleepingBag bag, UnityEngine.Vector3 position, SleepingBag+SleepingBagResetReason reason, BasePlayer forPlayer) [0x0001a] in <02a35e205e584c55945c4001b7eb814a>:0 
  at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.SleepingBag.SetBagTimer_Patch1(SleepingBag,UnityEngine.Vector3,SleepingBag/SleepingBagResetReason,BasePlayer)
  at SleepingBag.OnPlayerDeath (BasePlayer player) [0x00024] in <a3148f13afc149549234be0c76bbd845>:0 
  at BasePlayer.Die (HitInfo info) [0x000c8] in <a3148f13afc149549234be0c76bbd845>:0 
  at BasePlayer.Load (BaseNetworkable+LoadInfo info) [0x0022e] in <a3148f13afc149549234be0c76bbd845>:0 
  at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.SaveRestore.Load_Patch1(string,bool)

Edited by monsterqueen
tofurahie

Posted

Changed Status from Pending to Closed

Changed Fixed In to Next Version

monsterqueen

Posted (edited)

You forgot to null check the config which is what caused the error, should be like this to fully guard it. Pooling is outdated as well.

if (bag == null || _ins?._config == null)
    return true;
 

Edited by monsterqueen
tofurahie

Posted

13 hours ago, monsterqueen said:

You forgot to null check the config which is what caused the error, should be like this to fully guard it. Pooling is outdated as well.

if (bag == null || _ins?._config == null)
    return true;
 

The _ins variable won't be initialized before _config 

1.8m

Downloads

Total number of downloads.

8.4k

Customers

Total customers served.

127k

Files Sold

Total number of files sold.

2.6m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.