Null Key Error when merging two Refference Managers
Posted: Mon Feb 14, 2022 5:19 pm
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
This error doesn't happen in the Unity Editor, only in the standalone build. What could be causing this?
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