Null reference exception when changing context type to "None" in context holder

Issue #102 resolved
Trinidad Sibajas Bodoque created an issue

Steps:

  1. Create a scene object and add a “Context Holder” component to it.
  2. Set a “Context Type” value other than “None”.
  3. Try to set “None” again for the “Context Type”.

Expected result:

The context type should be changed to “None”.

Actual result:

The context type doesn’t change, and the console shows the following error:

NullReferenceException: Object reference not set to an instance of an object
Slash.Unity.DataBind.Editor.PropertyDrawers.ContextTypeDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/Slash.Unity.DataBind/Editor/Scripts/PropertyDrawers/ContextTypeDrawer.cs:36)
UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.Editor.DoDrawDefaultInspector (UnityEditor.SerializedObject obj) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.Editor.DoDrawDefaultInspector () (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.Editor.DrawDefaultInspector () (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.Editor.OnInspectorGUI () (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
Slash.Unity.DataBind.Editor.Editors.ContextHolderEditor.OnInspectorGUI () (at Assets/Slash.Unity.DataBind/Editor/Scripts/Editors/ContextHolderEditor.cs:79)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.PopupCallbackInfo:SetEnumValueDelegate(Object, String[], Int32)

Comments (4)

  1. Log in to comment