diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2015-04-26 17:32:39 -0400 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2015-04-26 17:32:39 -0400 |
commit | f207ba2152baa95a6a4b740a9136f4a9d7f31dbd (patch) | |
tree | e5749bb2452ebc7daf33e37d23c29d656098b167 /library | |
parent | b253289b1f90783db536a490b63530b72df2ea8b (diff) | |
download | AntennaPod-f207ba2152baa95a6a4b740a9136f4a9d7f31dbd.zip |
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
Diffstat (limited to 'library')
-rw-r--r-- | library/drag-sort-listview/src/main/java/com/mobeta/android/dslv/DragSortController.java | 6 |
1 files changed, 6 insertions, 0 deletions
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(); |