Skip to content

SerializableHashSet: causes an error if the set is null while inspecting it #25

@iconmaster5326

Description

@iconmaster5326

I'm using the master commit of this repository. I have a SerializableHashSet<Vector2Int> brought up in the inspector, but the set itself is null. When I try to press the + button in order to instantiate this hash set, I get an error:

NullReferenceException: Object reference not set to an instance of an object
SerializableDictionaryPropertyDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/SerializableDictionary/Editor/SerializableDictionaryPropertyDrawer.cs:153)
UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <cb5f6353539a46708761eca227df3590>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <cb5f6353539a46708761eca227df3590>:0)
UnityEditor.GenericInspector.OnOptimizedInspectorGUI (UnityEngine.Rect contentRect) (at <cb5f6353539a46708761eca227df3590>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <47d44085adbe43bd896d97295bdef4f5>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions