Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BasicDragger: Added null checks DRAG_END case #83

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dr3amr2
Copy link

@dr3amr2 dr3amr2 commented Jan 12, 2017

I was running into some issues with the dragContext being null when a drag event ended. It gave a bunch of NPE and made my program unresponsive. This was my fix for it.

@pdavidc
Copy link
Contributor

pdavidc commented Jan 12, 2017

Can you provide more detail on the conditions under which this happens? It's a trivial change but we'd like to understand what's going on.

@dr3amr2
Copy link
Author

dr3amr2 commented Jan 12, 2017

RaptorX uses one WWSelectListener to handle all of the dragging, and we're using different types of map object that triggers the dragging. The simpler map objects (2D shapes, UserFacingIcon, etc) where we can implement the Movable, Draggable interfaces works without any issues. While the more custom one like Range Rings and 3D Shapes, has a lot going on where we have to intercept the listener to re-render certain things. These classes does not have the Movable/Dragable interfaces, so the dragContext was never initialized for the BasicDragger. This causes some issues when the BasicDragger class gets called to end a drag event, but the dragContext was null.

Sorry the issues was pretty convoluted, hopefully my comment makes some sense. Let me know if you need additional information.

@pdavidc
Copy link
Contributor

pdavidc commented Jan 12, 2017

Thanks, @dr3amr2. We always appreciate getting the background and context behind an issue; your description absolutely makes sense.

@dr3amr2
Copy link
Author

dr3amr2 commented Jan 12, 2017

Awesome, I'm glad that my comment was somewhat coherent.

Thanks for being quick on reviewing this @pdavidc

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

Successfully merging this pull request may close these issues.

2 participants