Null Key Error when merging two Refference Managers

Discussion and help for Easy Save 3
Post Reply
funtomata
Posts: 26
Joined: Tue Feb 23, 2021 4:25 pm

Null Key Error when merging two Refference Managers

Post by funtomata »

Hi,
I'm dealing with an issue that only happens on the build in my game and not in the Unity editor.

We have a persistent scene that loads each level additively. The persistent scene itself has some stuff it needs to save, and so do the scenes we load. So we put a ReferenceManager on the persistent scene and one on each additive scene.

When an additive scene is loaded, the Awake in ES3ReferenceMgrBase is called and from what I understand, it notices there's already a current Reference Manager and tries to merge its references.

However this results in a null reference exception as you can see in our logs

Code: Select all

ArgumentNullException: Value cannot be null.
Parameter name: key
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x00008] in <2b3a3162be434770b7a4fac8b896e90c>:0 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].set_Item (TKey key, TValue value) [0x00000] in <2b3a3162be434770b7a4fac8b896e90c>:0 
  at ES3Internal.ES3ReferenceMgrBase.Add (UnityEngine.Object obj, System.Int64 id) [0x00045] in /Volumes/G-Raid/unity/Asfalia-recovery/Asfalia/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs:252 
  at ES3Internal.ES3ReferenceMgrBase.Merge (ES3Internal.ES3ReferenceMgrBase otherMgr) [0x00018] in /Volumes/G-Raid/unity/Asfalia-recovery/Asfalia/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs:126 
  at ES3Internal.ES3ReferenceMgrBase.Awake () [0x00037] in /Volumes/G-Raid/unity/Asfalia-recovery/Asfalia/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs:104 
This error doesn't happen in the Unity Editor, only in the standalone build. What could be causing this?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Null Key Error when merging two Refference Managers

Post by Joel »

Hi there,

Are you using the latest version of Easy Save?

If so, please could you make a simple project which replicates this so I can see what is happening at my end.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply