fredsa / gwt-dnd

Library providing easy to use mouse or touch based drag-and-drop capabilities to GWT
42 stars 41 forks source link

NullPointerException in MouseDragHandler.makeNotDraggable #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using gwt-dnd 3.1.1

RegisteredDraggable's member variables mouseDownHandlerRegistration and 
touchStartHandlerRegistration may be null. This is not checked for in 
MouseDragHandler.makeNotDraggable, and causes a NullPointerException

Workaround is to ensure the dragHandle implements both HasTouchStartHandlers 
and HasMouseDownHandlers

Original issue reported on code.google.com by erik.spe...@gmail.com on 25 Sep 2011 at 5:53

GoogleCodeExporter commented 9 years ago

Original comment by fredsa on 31 Jan 2012 at 6:36

GoogleCodeExporter commented 9 years ago
In the ctor of class RegisteredDraggable, a TouchStartHandler is added *only* 
if the widget implements HasTouchStartHandlers (which not all Widgets do 
implement). The same check does *not* happen in the method makeNotDraggable.

registeredDraggable.getMouseDownHandlerRegistration().removeHandler();
registeredDraggable.getTouchStartHandlerRegistration().removeHandler(); // 
crash - NullPointerException

Original comment by mma...@gmail.com on 22 Oct 2012 at 7:42

GoogleCodeExporter commented 9 years ago
Fixed in ad5827ca9b3facdb7099b82a87e8e223d44d0d8e

Original comment by fredsa@google.com on 28 Mar 2013 at 9:57