aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Rolka2013-04-25 07:35:41 (EDT)
committerGerrit Code Review @ Eclipse.org2013-04-25 09:29:07 (EDT)
commit4a6de6d78ccddd12357a9e0b6a06cc22c1fcab6d (patch)
treed2df56c659fab2b65980ae5799cf3234b88f0ba1
parent73ff2bfb5358ccb1b213c6724b810051b114849e (diff)
downloadeclipse.platform.ui-4a6de6d78ccddd12357a9e0b6a06cc22c1fcab6d.zip
eclipse.platform.ui-4a6de6d78ccddd12357a9e0b6a06cc22c1fcab6d.tar.gz
eclipse.platform.ui-4a6de6d78ccddd12357a9e0b6a06cc22c1fcab6d.tar.bz2
Bug 387475 - Error in editor initialization cause NPE in accessingrefs/changes/81/12181/3
compatibility editor
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java3
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java5
2 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
index eb98633..3c50b03 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
@@ -3125,6 +3125,9 @@ public class WorkbenchPage extends CompatibleWorkbenchPage implements
partService.showPart(editor, PartState.VISIBLE);
CompatibilityEditor compatibilityEditor = (CompatibilityEditor) editor.getObject();
+ if (compatibilityEditor == null) {
+ return null;
+ }
if (activate) {
partService.activate(editor);
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java
index 818b2cf..64f1266 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java
@@ -306,6 +306,11 @@ public abstract class CompatibilityPart implements ISelectionChangedListener {
if (!handlePartInitException(e)) {
return;
}
+ } catch (Exception e) {
+ WorkbenchPlugin.log("Unable to initialize part", e); //$NON-NLS-1$
+ if (!handlePartInitException(new PartInitException(e.getMessage()))) {
+ return;
+ }
}
// hook reference listeners to the part