From 8a1587812adf2fd7602cbc170e9853a3f3af8d06 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Tue, 4 Apr 2017 14:52:07 +0300 Subject: [PATCH] Fix crash on menu swipe --- .../net/osmand/plus/views/controls/HorizontalSwipeConfirm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/controls/HorizontalSwipeConfirm.java b/OsmAnd/src/net/osmand/plus/views/controls/HorizontalSwipeConfirm.java index 2f72050648..c3337ee031 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/HorizontalSwipeConfirm.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/HorizontalSwipeConfirm.java @@ -41,7 +41,7 @@ public class HorizontalSwipeConfirm implements GestureDetector.OnGestureListener @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) { + if (e1 == null || e2 == null || Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) { return false; } // right to left swipe