Skip to content

Commit

Permalink
fix: missing guarding leads to crashs under Android prior to API 23
Browse files Browse the repository at this point in the history
  • Loading branch information
queequac committed May 12, 2022
1 parent 752ba30 commit 97a88cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Uno.UI/UI/Xaml/Input/PointerRoutedEventArgs.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ private PointerPointProperties GetProperties(MotionEventToolType type, MotionEve
break;
}

if (updates.TryGetValue(_nativeEvent.ActionButton, out var update))
if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.M // ActionButton was introduced with API 23 (https://developer.android.com/reference/android/view/MotionEvent.html#getActionButton())
&& updates.TryGetValue(_nativeEvent.ActionButton, out var update))
{
props.PointerUpdateKind = update;
}
Expand Down

0 comments on commit 97a88cb

Please sign in to comment.