Bug 99095 - NullPointerException in CreationTool.handleButtonDown
Summary: NullPointerException in CreationTool.handleButtonDown
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1.0 RC2   Edit
Assignee: Pratik Shah CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-08 21:22 EDT by Chris Lee CLA
Modified: 2005-06-14 11:44 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lee CLA 2005-06-08 21:22:55 EDT
getTargetEditPart() is allowed to return null (and does if the mouse is over 
an invalid EditPart target, causing it to show the 'no drop' sign), and there 
is a line at the end of the method that tries to use it without checking for 
null:

helper = (SnapToHelper)getTargetEditPart().getAdapter(SnapToHelper.class);

A simple check for null here would avoid the NPE.
Comment 1 Randy Hudson CLA 2005-06-09 09:35:46 EDT
PPS, make sure you agree (I didn't have time to look at the code) then try to 
get in for RC2.
Comment 2 Pratik Shah CLA 2005-06-09 09:49:42 EDT
Fixed and released to HEAD.
Comment 3 Randy Hudson CLA 2005-06-14 11:42:29 EDT
Reopening, the real fix should be that the tool transitions to the invalid state
on mouse down if there is not target editpart. It doesn't make sense to show
resize feedback if there is no target.

Current change can stay. Real fix to come post 3.1.0.
Comment 4 Randy Hudson CLA 2005-06-14 11:44:32 EDT
I guess we need to track what goes into RC2, so I've opened a separate bug 99990
for the post 3.1 change.