Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359927 - FacetProjectCreationDataModelProvider should have a null check for model in dispose method
Summary: FacetProjectCreationDataModelProvider should have a null check for model in d...
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.common (show other bugs)
Version: 3.2.5   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2.5   Edit
Assignee: Roberto Sanchez Herrera CLA
QA Contact: Carl Anderson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 360039
  Show dependency tree
 
Reported: 2011-10-04 17:44 EDT by Roberto Sanchez Herrera CLA
Modified: 2011-10-05 16:15 EDT (History)
0 users

See Also:
ccc: review+


Attachments
Proposed fix (1.25 KB, patch)
2011-10-04 17:48 EDT, Roberto Sanchez Herrera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Sanchez Herrera CLA 2011-10-04 17:44:56 EDT
While fixing bug 357558, I added some clean up code in the dispose method of class FacetProjectCreationDataModelProvider, that included removing a listener from nestedProjectDM and setting the data model to null. But there can be cases in which the FacetProjectCreationDataModelProvider is disposed twice, and in those cases, a NPE will be thrown when running this line: 

IDataModel nestedProjectDM = model.getNestedModel(NESTED_PROJECT_DM);

A null check should be added to protect the method from throwing the NPE if the FacetProjectCreationDataModelProvider is disposed twice. 

Marking as major because is affecting an adopter.
Comment 1 Roberto Sanchez Herrera CLA 2011-10-04 17:48:56 EDT
Created attachment 204555 [details]
Proposed fix
Comment 2 Roberto Sanchez Herrera CLA 2011-10-05 16:11:55 EDT
Code committed to R3_2_maintenance for WTP 3.2.5.
Comment 3 Roberto Sanchez Herrera CLA 2011-10-05 16:14:36 EDT
This code cannot be committed to HEAD until bug 357846 is resolved. So, I will clone this bug, make the clone depending on bug 357846, and resolve this bug.