InvalidOperationException: Stack empty. when Inspect Object

Issue #930 resolved
David López Rechac created an issue

1. What happened?

When inspecting anything, all seem to work fine, but the error “InvalidOperationException: Stack empty.” is shown twice.

InvalidOperationException: Stack empty.
System.Collections.Generic.Stack`1[T].Pop () (at <391154401d904e0ca279fe00c621b01b>:0)
Sirenix.OdinInspector.Editor.InspectorProperty.PopDraw () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:988)
Sirenix.OdinInspector.Editor.InspectorProperty.Draw (UnityEngine.GUIContent defaultLabel) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:951)
Sirenix.OdinInspector.Editor.InspectorProperty.Draw () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:737)
Sirenix.OdinInspector.Editor.Drawers.UnityObjectRootDrawer`1[T].DrawPropertyLayout (UnityEngine.GUIContent label) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/UnityObjectRootDrawer.cs:60)
Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (UnityEngine.GUIContent label) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155)
Sirenix.OdinInspector.Editor.Drawers.FixBrokenUnityObjectWrapperDrawer`1[T].DrawPropertyLayout (UnityEngine.GUIContent label) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/FixBrokenUnityObjectWrapperDrawer.cs:41)
Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (UnityEngine.GUIContent label) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:109)
Sirenix.OdinInspector.Editor.InspectorProperty.Draw (UnityEngine.GUIContent defaultLabel) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:849)
Rethrow as OdinPropertyException: This error occurred while being drawn by Odin.
Current IMGUI event: Used
Odin Property Path: $ROOT
Odin Drawer Chain:
> FixBrokenUnityObjectWrapperDrawer<Test>
> UnityObjectRootDrawer<Test>
> CompositeDrawer.
UnityEngine.Debug:LogException(Exception)
Sirenix.OdinInspector.Editor.InspectorProperty:Draw(GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:926)
Sirenix.OdinInspector.Editor.PropertyTree:DrawProperties() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:556)
Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:448)
Sirenix.OdinInspector.Editor.OdinEditor:DrawTree() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:97)
Sirenix.OdinInspector.Editor.OdinEditor:DrawOdinInspector() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:254)
Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:79)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
InvalidOperationException: Stack empty.
System.Collections.Generic.Stack`1[T].Pop () (at <391154401d904e0ca279fe00c621b01b>:0)
Sirenix.OdinInspector.Editor.InspectorProperty.PopDraw () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:988)
Sirenix.OdinInspector.Editor.InspectorProperty.Draw (UnityEngine.GUIContent defaultLabel) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:951)
Sirenix.OdinInspector.Editor.PropertyTree.DrawProperties () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:556)
Sirenix.OdinInspector.Editor.PropertyTree.Draw (System.Boolean applyUndo) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:448)
Sirenix.OdinInspector.Editor.OdinEditor.DrawTree () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:97)
Sirenix.OdinInspector.Editor.OdinEditor.DrawOdinInspector () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:254)
Sirenix.OdinInspector.Editor.OdinEditor.OnInspectorGUI () (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:79)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <46e1bf9196684231bfdf718689da7102>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

After this, if I enter play mode another error arises:

GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

2. How can we reproduce it?

Blank new project no assets, only Odin. Only one script attached to an empty GameObject.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test : MonoBehaviour
{
    [SerializeField] GameObject test;

}

Created 3D Cube.

Assign the cube in test field.

Press the inspect button and the error is shown.

3. If screenshots would help explain or demonstrate your issue, please include these.

4. What version of Unity are you using?

2022.2.19f1

5. What version of Odin are you using? (See "Tools > Odin Inspector > About")

3.1.12.2

6. Do you have Editor Only mode enabled?

No

7. What operating system are you on?

Windows 10 Pro 64 bits

Comments (1)

  1. Log in to comment