Skip to content

Commit ffce42c

Browse files
author
David Kline
authored
Merge pull request #3671 from keveleigh/keyword-profile-fix
Fix exceptions deleting SpeechInputHandler's last keyword
2 parents 24db6e3 + 968ec1d commit ffce42c

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)