From f207ba2152baa95a6a4b740a9136f4a9d7f31dbd Mon Sep 17 00:00:00 2001 From: Tom Hennen Date: Sun, 26 Apr 2015 17:32:39 -0400 Subject: Fixes NullPointerException in DragSortController.onScroll. There is probably a better fix (as mentioned here http://stackoverflow.com/a/4582899/6839) But this will work in the short term and doesn't require anything too drastic. closes AntennaPod/AntennaPod#765 --- .../src/main/java/com/mobeta/android/dslv/DragSortController.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'library') diff --git a/library/drag-sort-listview/src/main/java/com/mobeta/android/dslv/DragSortController.java b/library/drag-sort-listview/src/main/java/com/mobeta/android/dslv/DragSortController.java index 6acf6b42e..fef853d22 100644 --- a/library/drag-sort-listview/src/main/java/com/mobeta/android/dslv/DragSortController.java +++ b/library/drag-sort-listview/src/main/java/com/mobeta/android/dslv/DragSortController.java @@ -378,6 +378,12 @@ public class DragSortController extends SimpleFloatViewManager implements View.O @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { + // it can happen where the motion events are null + if (e1 == null || e2 == null) { + // we can't really do anything + return false; + } + final int x1 = (int) e1.getX(); final int y1 = (int) e1.getY(); final int x2 = (int) e2.getX(); -- cgit v1.2.3