Skip to content

Commit

Permalink
Merge pull request #8757 from queequac/fix/missing-guarding
Browse files Browse the repository at this point in the history
fix: missing guarding leads to crashes under Android prior to API 23
  • Loading branch information
jeromelaban authored May 24, 2022
2 parents 2db0ffb + 97a88cb commit 8723d04
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 8723d04

Please sign in to comment.