Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Constant2018-11-13 05:32:23 -0500
committerOlivier Constant2018-11-13 05:32:23 -0500
commit82cafa4b77a8d7f6eadcbb129bdb9af2abecddbe (patch)
tree71d7109646aa851c24a3bcae8fc876f85363fdc3
parentb1dca5a8dd60c589b6e9f99f88fb203bde23928d (diff)
downloadorg.eclipse.emf.diffmerge.core-0.10.1.tar.gz
org.eclipse.emf.diffmerge.core-0.10.1.tar.xz
org.eclipse.emf.diffmerge.core-0.10.1.zip
Bug 541071 - [2018-12] NPE at startupv0.10.10.10.x
Change-Id: Ie3d27ecb2b3dde5860f08716fdb5a5d3607d6733 Signed-off-by: Olivier Constant <olivier.constant@thalesgroup.com>
-rw-r--r--plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/EMFDiffMergeEditorInput.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/EMFDiffMergeEditorInput.java b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/EMFDiffMergeEditorInput.java
index 94a15ad8..0bf0acf0 100644
--- a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/EMFDiffMergeEditorInput.java
+++ b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/setup/EMFDiffMergeEditorInput.java
@@ -75,6 +75,7 @@ import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.views.properties.IPropertySheetPage;
@@ -788,8 +789,17 @@ public class EMFDiffMergeEditorInput extends CompareEditorInput {
public void dispose() {
super.dispose();
// Unregister properties view as selection listener
- ISelectionService service = getSite().getWorkbenchWindow().getSelectionService();
- service.removeSelectionListener(this);
+ IWorkbenchWindow window = null;
+ IWorkbenchSite site = getSite();
+ if (site != null) {
+ window = site.getWorkbenchWindow();
+ } else {
+ window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ }
+ if (window != null) {
+ ISelectionService service = window.getSelectionService();
+ service.removeSelectionListener(this);
+ }
}
/**
* Return the Properties view if already opened

Back to the top