Interface list giving null reference errors and changing the type of interface

Issue #369 resolved
Former user created an issue

I have a list of Interface that I'm serializing, when moving things around in the scene when I have a prefab of the thing I get null reference errors and in some case the interface becomes another type of the same interface. I couldn't reproduce that part of the bug on the reproduce package I'm attaching but I reproduced the null reference errors that happened there and are probably causing my problem in the full project.

To reproduce (at least the null reference, open the ReproInterfaceBug scene, select one of the triggers and move something on the actions list around.

NullReferenceException: Object reference not set to an instance of an object
(wrapper dynamic-method) object.TActionStuffs.get_thisIsString (TActionStuffs&) <IL 0x00002, 0x0003f>
Sirenix.OdinInspector.Editor.GetterSetter`2<TActionStuffs, string>.GetValue (TActionStuffs&) <0x000cf>
Sirenix.OdinInspector.Editor.PropertyValueEntry`2<TActionStuffs, string>.UpdateValues () <0x00185>
Sirenix.OdinInspector.Editor.PropertyValueEntry.Update () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/TwoDimensionalArrayDrawer.cs:707)
Sirenix.OdinInspector.Editor.PrefabModificationHandler.RegisterPrefabValueModification (Sirenix.OdinInspector.Editor.InspectorProperty,int,bool) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Resolvers/Locators/DefaultOdinAttributeProcessorLocator.cs:39)
Sirenix.OdinInspector.Editor.PrefabModificationHandler.GetPrefabModificationType (Sirenix.OdinInspector.Editor.InspectorProperty,bool) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Resolvers/Locators/DefaultOdinAttributeProcessorLocator.cs:25)
Sirenix.OdinInspector.Editor.InspectorProperty.Update (bool) <IL 0x000b4, 0x005db>
Sirenix.OdinInspector.Editor.BaseCollectionResolver`1<TActionInterface[]>.ApplyChanges () <0x003b0>
Sirenix.OdinInspector.Editor.PropertyTree`1<Trigger>.ApplyChanges () <0x00298>
Sirenix.OdinInspector.Editor.InspectorUtilities.EndDrawPropertyTree (Sirenix.OdinInspector.Editor.PropertyTree) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Utilities/Persistent/PersistentContext.cs:102)
Sirenix.OdinInspector.Editor.PropertyTree.Draw (bool) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/MaxValueAttributeDrawer.cs:412)
Sirenix.OdinInspector.Editor.OdinEditor.DrawTree () <IL 0x00007, 0x00079>
Sirenix.OdinInspector.Editor.OdinEditor.DrawOdinInspector () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyListValueEntryChanger.cs:80)
Sirenix.OdinInspector.Editor.OdinEditor.OnInspectorGUI () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyListValueEntryChanger.cs:20)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[],int,bool,bool&,UnityEngine.Rect&) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1242)

Comments (1)

  1. Tor Esa Vestergaard

    Figured out what was going on using your package, and fixed it in the 2.0 beta. Thanks for the report!

  2. Log in to comment