Skip to content
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.

NPE in PickupDragController.dragEnd() with null context.dropController #194

Open
cueman opened this issue Jun 3, 2016 · 0 comments
Open

Comments

@cueman
Copy link

cueman commented Jun 3, 2016

In PickupDragController, lots of code is careful to check whether context.dropController is null or not. On dragStart(), context.dropController can be set, but is sometimes left null.

dragMove() should set context.dropController, so it ought to be non-null by the time dragEnd() is called. However, I'm finding in production that there are null pointer exceptions that I've traced back to context.dropController being null when dragEnd() is called.

This happens because PickupDragController.dragEnd() always calls a method on context.dropController, even if it is null.

Looking at the code, it appears to me that context.dropController will always be set to a non-null value by dragMove(). This suggests that sometimes dragMove() isn't being called. I've not been able to replicate this, but I've seen exceptions that show it happens infrequently across my users, but often enough to be a problem. Perhaps this can happen when the computer or browser is under heavy load.

Perhaps the solution is simply to make PickupDragController.dragEnd() check whether context.dropController is null or not before calling methods on it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant