NullPointerException when try to get Mouse Event type in drag and drop.

Hi,

I want to display a message when user made invalid drops. Hence i have written code to get the mouse event type. If it ‘8’ means user released mouse (dragging is end). It is working good as expected, but some NullPointerException is comming always in the log. Please suggest how to avoid this NullPointerException.

@Override public boolean accept( final DragAndDropEvent dragEvent ) { final Component compdestination = dragEvent.getTargetDetails().getTarget(); if( compdestination instanceof DragAndDropWrapper ) { final WrapperTargetDetails details = (WrapperTargetDetails) dragEvent.getTargetDetails(); int typeVal = details.getMouseEvent().getType(); // <<<< NPException is coming here. if( typeVal == 8 ) { displayInvalisDrop(); } } } Here is the log message
java.lang.NullPointerException: null
at com.vaadin.shared.MouseEventDetails.deSerialize(MouseEventDetails.java:175)
at com.vaadin.event.dd.TargetDetailsImpl.getMouseEvent(TargetDetailsImpl.java:51)

Hi,

I couldn’t reproduce this behavior. Could you post the rest of the code?