Skip to content

Commit

Permalink
fixing issue with pointerid negative numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
RFedorov committed Jan 25, 2022
1 parent 867d12d commit 3be4c2f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ internal static VRTK4_UIPointer GetByEventData(PointerEventData eventData)

return null;
}

/// <summary>
/// Please check if event system if VRTK4_EventSystem.IsVRTK4Active()
/// </summary>
Expand All @@ -422,7 +422,7 @@ public static VRTK4_UIPointer GetByPointerId(int pointerId)
return null;
}

if (VrtkUiPointers.Count > pointerId)
if (VrtkUiPointers.Count > pointerId && pointerId >= 0)
{
return VrtkUiPointers[pointerId];
}
Expand Down

0 comments on commit 3be4c2f

Please sign in to comment.