Skip to content

Commit 1e3ebb4

Browse files
committed
Sanitize array access index for provider foldouts for newly created data providers
1 parent a3ce3a0 commit 1e3ebb4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Assets/MRTK/Core/Inspectors/Profiles/DataProviderAccessServiceInspector.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ protected bool RenderDataProviderEntry(int index, GUIContent removeContent, Syst
167167
{
168168
using (new EditorGUILayout.HorizontalScope())
169169
{
170+
if (index < 0 || index >= providerFoldouts.Count) index = 0;
170171
providerFoldouts[index] = EditorGUILayout.Foldout(providerFoldouts[index], providerProperties.componentName.stringValue, true);
171172

172173
if (GUILayout.Button(removeContent, EditorStyles.miniButtonRight, GUILayout.Width(24f)))

0 commit comments

Comments
 (0)