Using [InlineEditor] to preview a ScriptableObject and deleting the scriptable from code

Issue #50 resolved
João Cabral created an issue

Basically I'm using [InlineEditor] to preview a ScriptableObject and comboing it with [OnValueChanged] to check if the reference is Null, and if it is I destroy the ScriptableObject.

I get the following errors:

(version 0.9.0.5)

MissingReferenceException: The object of type 'ProximityScriptable' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEditor.Editor.get_targetTitle () (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:137)
UnityEditor.Editor.OnHeaderGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:362)
UnityEditor.Editor.DrawHeader () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:355)
Sirenix.OdinInspector.Editor.Drawers.InlineEditorAttributeDrawer`1[ProximityScriptable].DrawPropertyLayout (IPropertyValueEntry`1 entry, Sirenix.OdinInspector.InlineEditorAttribute attribute, UnityEngine.GUIContent label) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/InlineEditorAttributeDrawer.cs:194)
UnityEngine.Debug:LogException(Exception)
Sirenix.OdinInspector.Editor.Drawers.InlineEditorAttributeDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, InlineEditorAttribute, GUIContent) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/InlineEditorAttributeDrawer.cs:253)
Sirenix.OdinInspector.Editor.OdinAttributeDrawer`2:DrawPropertyLayout(InspectorProperty, InlineEditorAttribute, GUIContent) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinAttributeDrawer.cs:478)
Sirenix.OdinInspector.Editor.OdinAttributeDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinAttributeDrawer.cs:246)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:128)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/InspectorUtilities.cs:356)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/InspectorUtilities.cs:303)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertyTree(PropertyTree, Boolean, Func`2) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/InspectorUtilities.cs:205)
Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:88)
Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:169)
UnityEditor.DockArea:OnGUI()
Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
UnityEditor.DockArea:OnGUI()
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)

Comments (3)

  1. mSkull001
    • changed status to open

    We've implemented a potential fix, but we've not been getting the same errors you've been describing. Could you post a code sample to replicate the issue, so we can ensure it works correctly?

  2. João Cabral reporter

    I'll only be able to do that in a couple of hours.
    Until then, maybe this has to do with another bug I submitted? Issue #48
    And since you guys have solved that one on your end, this one is also fixed.

  3. Log in to comment