Bug 463043 - Missing null checks for curSharedRef in intro
Summary: Missing null checks for curSharedRef in intro
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.5 M7   Edit
Assignee: Dirk Fauth CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatfix
Depends on:
Blocks:
 
Reported: 2015-03-25 03:55 EDT by Dirk Fauth CLA
Modified: 2015-04-28 16:10 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Fauth CLA 2015-03-25 03:55:36 EDT
The curSharedRef of models should always be checked for null values, since it might be null anyways. 

This becomes even more important related to Bug 457939, where the fix is to set curSharedRef to null in case of closing a perspective.

I double checked every call to getCurSharedRef() in the platform code, and despite two places, every access of the curSharedRef has a null check before.

The two places where there is no such check are

ViewIntroAdapter#getIntroStack()
WorkbenchIntroManager#getIntroStack()

IMHO the null check should always be performed.

The patch for Bug 457939 is currently blocked by this issue. Looking at the stacktrace added as comment to the patch [1], a NPE occurs on closing the intro. But at that point there should be no curSharedRef from my understanding. So the null check also makes semantically sense, since a closed part can not be maximized.


[1] https://git.eclipse.org/r/#/c/41337
Comment 1 Eclipse Genie CLA 2015-03-25 03:58:25 EDT
New Gerrit change created: https://git.eclipse.org/r/44555
Comment 2 Brian de Alwis CLA 2015-04-01 14:53:42 EDT
Thanks Dirk.  Fixed for M7
Comment 4 Dirk Fauth CLA 2015-04-28 16:10:43 EDT
I don't see an issue anymore in the latest integration build.

Tested with Eclipse 4.5.0 Integration Build: I20150428-0100.