Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317745 - NullPointerException in org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor$PropertyChangeListener
Summary: NullPointerException in org.eclipse.gmf.runtime.diagram.ui.resources.editor.p...
Status: NEW
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 2.2   Edit
Hardware: PC Windows 7
: P3 normal
Target Milestone: ---   Edit
Assignee: Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-23 15:56 EDT by Zac Wolfe CLA
Modified: 2010-06-23 15:56 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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