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

Bug 283479

Summary: [ViewMgmt] [ActivityMgmt] NullpointerException during saving state of view registry with disabled xp based activities
Product: [Eclipse Project] Platform Reporter: Boris Bokowski <bokowski>
Component: UIAssignee: Boris Bokowski <bokowski>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pwebster, sascha.zak
Version: 3.5   
Target Milestone: 3.6 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 282874    
Bug Blocks:    

Description Boris Bokowski CLA 2009-07-14 22:25:19 EDT
+++ This bug was initially created as a clone of Bug #282874 +++

I'm using expression based activities and perspectives to provide UI elements depending on a user's role. Login/logout sets a variable of a custum source provider describing the user's role and triggers the expressions used to enable/disable some activies. After successful login a role specific perspective is shown.

After logout (also implicitly done before closing the workbench) with disabling the acitivies and closing the workbench ViewRegistry#saveState(IMemento) raises a NullPointerException.

The line

287 IViewDescriptor desc = viewReg.find(refs[i].getId());

returns null because of the (during logout) disabled activities for views that were part of the role specific perspective and subsequent causes the NullPointerException.

From my point of view this has to be at least checked against null.
Comment 1 Boris Bokowski CLA 2009-07-14 22:26:19 EDT
Patch from bug 282874 released to HEAD with minor modifications (copyright header).
Comment 2 Boris Bokowski CLA 2009-07-14 22:26:36 EDT
Marking as fixed.