107place
0 votes Vote

Null reference Exception - Unity 2021.2.0b3 (beta)

I updated a project from Unity 2021.1 to 2021.2 (beta) and now Map Magic gives a null reference error:

NullReferenceException: Object reference not set to an instance of an object
Den.Tools.Serialization.Serializer.SerializeRecursive (System.String name, System.Object val, System.Collections.Generic.Dictionary`2[TKey,TValue] serializedObjsIds, System.Collections.Generic.List`1[T] unityObjs, System.String offset) (at Assets/MapMagic/Tools/Serializer/Serialize.cs:218)
Den.Tools.Serialization.Serializer.SerializeRecursive (System.String name, System.Object val, System.Collections.Generic.Dictionary`2[TKey,TValue] serializedObjsIds, System.Collections.Generic.List`1[T] unityObjs, System.String offset) (at Assets/MapMagic/Tools/Serializer/Serialize.cs:218)
Den.Tools.Serialization.Serializer.Serialize (System.Object val, UnityEngine.Object[]& unityObjs) (at Assets/MapMagic/Tools/Serializer/Serialize.cs:64)
MapMagic.Expose.Override.OnBeforeSerialize () (at Assets/MapMagic/Expose/Override.cs:244)
Den.Tools.Serializer.SerializeObject (System.Object obj, System.Collections.Generic.Dictionary`2[TKey,TValue] serialized, System.Boolean skipNoCopyAttribute, System.Action`2[T1,T2] onAfterSerialize) (at Assets/MapMagic/Tools/Serializer.cs:379)
Den.Tools.Serializer.SerializeObject (System.Object obj, System.Collections.Generic.Dictionary`2[TKey,TValue] serialized, System.Boolean skipNoCopyAttribute, System.Action`2[T1,T2] onAfterSerialize) (at Assets/MapMagic/Tools/Serializer.cs:422)
Den.Tools.Serializer.Serialize (System.Object obj, System.Action`2[T1,T2] onAfterSerialize) (at Assets/MapMagic/Tools/Serializer.cs:177)
MapMagic.Nodes.GraphSerializer200Beta.Serialize (MapMagic.Nodes.Graph graph) (at Assets/MapMagic/Nodes/GraphSerializer.cs:53)
MapMagic.Nodes.Graph.OnBeforeSerialize () (at Assets/MapMagic/Nodes/Graph.cs:1149)

Conor , 28.07.2021, 17:57
Idea status: in process

Comments

Wraith, 28.07.2021, 21:47
When does this error occur? Is there any way to reproduce it?
Conor, 29.07.2021, 15:17
Create a new URP project with Unity 2021.2.0b4.3123 (beta).
Create a new standard scene.
Import Map Magic 2 and add a Map Magic object.
There's an exception error about Graph data not assigned. Click 'Create' in the map magic object and the error above is triggered. The Graph is not created by Map Magic and the scene has no terrain.
Wraith, 31.07.2021, 11:32
Thanks, will look into it. Does any error occur when you drag and drop MM graph to empty scene instead of creating it through the menu?
Conor, 01.08.2021, 15:22
It's not possible to create a new graph in Unity 2021.2.0b4 - the Create button in the map magic inspector doesn't work, so I can't test this.
Wraith, 01.08.2021, 23:55
There's a doc on this
https://gitlab.com/denispahunov/mapmagic/-/wikis/Main/QuickStart
Wraith, 07.08.2021, 22:59
Fixed for 2.1.7
cem, 27.09.2021, 15:14
It's not working on 2021.2.0b12 with 2.1.7. What can be the problem ?
Wraith, 28.09.2021, 21:30
In Unity Beta. I can't guarantee compatibility with non-released versions - it might be something broken in Unity, and it will take a lot of time to find it out.

Leave a comment