Merge pull request #773 from TomHennen/fix_npe_765

Fixes NullPointerException in DragSortController.onScroll.
This commit is contained in:
Tom Hennen 2015-04-26 17:36:02 -04:00
commit 273247907b
1 changed files with 6 additions and 0 deletions

View File

@ -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();