- changed version to 3.1.0.0
NullRef is thrown if InlineEditor field pointing to a component on a prefab is visible in the inspector on domain reload
Issue #876
new
-
What happened?
- Script compilation causes NullRef to be thrown if you have an inspector open that is showing an inline editor pointing to a component on a prefab asset.
-
How can we reproduce it?
- Create a script with a Transform field with an InlineEditor attribute. Attach script to a game object in your scene. Reference a transform from a prefab within your project. Change a script. Observe exception is thrown.
-
If screenshots would help explain or demonstrate your issue, please include these.
-
What version of Unity are you using?
- 2021.3.8f1
-
What version of Odin are you using? (See "Tools > Odin Inspector > About")
- 3.1.3.0
-
Do you have Editor Only mode enabled?
- Yes
-
What operating system are you on?
- Windows
Example Script:
using Sirenix.OdinInspector;
using UnityEngine;
public class TestScript : MonoBehaviour
{
[InlineEditor] public Transform Test;
}
Stacktrace:
NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.get_stringValue () (at <5f40cdb07bd44d76a23dad985a4ec283>:0)
UnityEditor.GameObjectInspector.OnDisable () (at <5f40cdb07bd44d76a23dad985a4ec283>:0)
UnityEngine.Object:DestroyImmediate(Object)
Sirenix.OdinInspector.Editor.Drawers.InlineEditorAttributeDrawer`1:DestroyEditors() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/InlineEditorAttributeDrawer.cs:422)
Sirenix.OdinInspector.Editor.Drawers.InlineEditorAttributeDrawer`1:System.IDisposable.Dispose() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/InlineEditorAttributeDrawer.cs:474)
Sirenix.OdinInspector.Editor.InspectorProperty:DisposeExistingSetup() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:1672)
Sirenix.OdinInspector.Editor.InspectorProperty:Dispose() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:1568)
Sirenix.OdinInspector.Editor.InspectorProperty:DisposeExistingSetup() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:1757)
Sirenix.OdinInspector.Editor.InspectorProperty:Dispose() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:1568)
Sirenix.OdinInspector.Editor.PropertyTree:ActuallyDispose() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:1125)
Sirenix.OdinInspector.Editor.PropertyTree:Dispose(Boolean) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:1104)
Sirenix.OdinInspector.Editor.PropertyTree:Dispose() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:1116)
Sirenix.OdinInspector.Editor.OdinEditor:OnDisable() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:176)
Comments (1)
-
reporter - Log in to comment
Incorrect version was specified in the Version dropdown. I am using 3.1.3.0. It is not available in the dropdown. I selected the next closest (3.1.0.0)