| Summary: | NPE if open a dialog when insert an item from palette | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Masaki Wakao <wakao> |
| Component: | GEF-Legacy GEF (MVC) | Assignee: | Brendan Curran-Johnson <brendanc> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ahunter.eclipse |
| Version: | 3.2 | ||
| Target Milestone: | 3.5.0 (Galileo) M6 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Actually NPE occurs at TargetingTool#updateTargetUnderMouse. Current view is null. Because TargetingTool.QueuedAutoexpose which calls above method is activated by asyncExec, AbstractTool#viewerExit() is called before TargetingTool#updateTargetUnderMouse() is called. AbstractTool#viewerExit() sets null for currentViewer, so the NPE occurs. Brendan, can you test with the Shapes example? I suspect this is fixed by Bug 133385 You are correct, this seems to have been fixed with Bug 133385. I couldn't reproduce the bug. |
NPE occurs if a dialog is opened when user clicks an item on the palette and clicks again on the edit area near the border of the edit area. You can reproduce with Shape example with the following patch: Change ShapeCreateCommand#execute() public void execute() { TitleAreaDialog d = new TitleAreaDialog(Display.getCurrent().getActiveShell()); d.open(); newShape.setLocation(bounds.getLocation()); Dimension size = bounds.getSize(); if (size.width > 0 && size.height > 0) newShape.setSize(size); redo(); }