Skip to content

Commit 968ec1d

Browse files
committed
Fix null ref when continuing to try displaying the final keyword when its been destroyed
1 parent 1439b5c commit 968ec1d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Assets/MixedRealityToolkit.SDK/Inspectors/Input/Handlers/SpeechInputHandlerInspector.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,18 @@ private void ShowList(SerializedProperty list)
113113
// the remove element button
114114
bool elementRemoved = GUILayout.Button(RemoveButtonContent, EditorStyles.miniButton, MiniButtonWidth);
115115

116+
EditorGUILayout.EndHorizontal();
117+
116118
if (elementRemoved)
117119
{
118120
list.DeleteArrayElementAtIndex(index);
119-
}
120121

121-
EditorGUILayout.EndHorizontal();
122+
if (index == list.arraySize)
123+
{
124+
EditorGUI.indentLevel--;
125+
return;
126+
}
127+
}
122128

123129
SerializedProperty keywordProperty = speechCommandProperty.FindPropertyRelative("keyword");
124130

0 commit comments

Comments
 (0)