aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Rolka2013-04-19 07:31:16 (EDT)
committerDaniel Rolka2013-04-19 07:31:16 (EDT)
commitcb86001c56fb6c4a732a379500f42da04aaa8367 (patch)
tree9bf3091d74ca4be24ff447483b00b602db9834ad
parent9c3826be84a31791cc80ce724ba66e1edd383769 (diff)
downloadeclipse.platform.ui-cb86001c56fb6c4a732a379500f42da04aaa8367.zip
eclipse.platform.ui-cb86001c56fb6c4a732a379500f42da04aaa8367.tar.gz
eclipse.platform.ui-cb86001c56fb6c4a732a379500f42da04aaa8367.tar.bz2
Bug 405800 - The NPE when the editor with invalid resource gets activerefs/changes/08/12008/4
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorReference.java7
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewReference.java7
2 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorReference.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorReference.java
index cc9c776..49756c4 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorReference.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -397,7 +397,10 @@ public class EditorReference extends WorkbenchPartReference implements IEditorRe
@Override
public PartSite getSite() {
- return (PartSite) legacyPart.getSite();
+ if (legacyPart != null) {
+ return (PartSite) legacyPart.getSite();
+ }
+ return null;
}
private static HashMap<String, Set<EditorActionBars>> actionCache = new HashMap<String, Set<EditorActionBars>>();
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewReference.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewReference.java
index c799d5a..fc4ed98 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewReference.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -153,6 +153,9 @@ public class ViewReference extends WorkbenchPartReference implements IViewRefere
@Override
public PartSite getSite() {
- return (PartSite) legacyPart.getSite();
+ if (legacyPart != null) {
+ return (PartSite) legacyPart.getSite();
+ }
+ return null;
}
}