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

Bug 317745

Summary: NullPointerException in org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor$PropertyChangeListener
Product: [Modeling] GMF-Runtime Reporter: Zac Wolfe <zac.wolfe>
Component: GeneralAssignee: Inbox <gmf.runtime.diagram-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 2.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Zac Wolfe CLA 2010-06-23 15:56:54 EDT
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor$PropertyChangeListener  needs to do null checking or allow the user to override the behavior.  

The problem happens when the PropertyChangeListener is invoked while there is no active page (eg. when a ProgressMonitor has focus).  

This code: 

if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart() == DiagramDocumentEditor.this) {
				String property = event.getProperty();
...


Should be changed to something like:

if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null && PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null && PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart() == DiagramDocumentEditor.this) {
...
Comment 1 Eclipse Webmaster CLA 2010-07-19 12:30:27 EDT
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug