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

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

@cueman

Description

@cueman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions