Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 494857

Summary: NPE in FXTypeTool.typedFilter.handle(KeyEvent event)
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF MVCAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) RC3   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2016-05-29 14:16:59 EDT
In case the active viewer is null when typed filter reacts, active tool fails with an NPE in line 240. This can e.g. be reproduced in the Zest Graph example. By performing a change then doing an undo/redo/redo. The last redo is not handled by the platform already, so the typed filter is queried to handle the event.
Comment 1 Alexander Nyßen CLA 2016-05-29 14:26:37 EDT
(In reply to Alexander Nyßen from comment #0)
> In case the active viewer is null when typed filter reacts, active tool
> fails with an NPE in line 240. This can e.g. be reproduced in the Zest Graph
> example. By performing a change then doing an undo/redo/redo. The last redo
> is not handled by the platform already, so the typed filter is queried to
> handle the event.

The steps to reproduce are not exact. What has to be done in detail is:

Select node 5 (so it has focus)
Double-click node 5 to step into (and loose focus)
Undo/redo/redo
Comment 2 Alexander Nyßen CLA 2016-05-29 14:32:23 EDT
I pushed the following change to origin/master:

- Fixed NPE and set targetNode directly instead of using viewer variable (which was not used for anything except determining the targetNode).

Resolving as fixed in 4.0.0 RC3.