Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2013-12-25 14:12:29 -0500
committerTom Schindl2013-12-25 14:12:29 -0500
commit09fdfe66a05d54515f4b06fa83ea7fe5846998b0 (patch)
treec748d162c6fed516d5d8191011fde4acf929c74c
parent1df9a98b4f1284a790c80a2770b363060210d2e8 (diff)
downloadorg.eclipse.efxclipse-09fdfe66a05d54515f4b06fa83ea7fe5846998b0.tar.gz
org.eclipse.efxclipse-09fdfe66a05d54515f4b06fa83ea7fe5846998b0.tar.xz
org.eclipse.efxclipse-09fdfe66a05d54515f4b06fa83ea7fe5846998b0.zip
Bug 424633 - NullPointerException is thrown when removing the last
perspective from perspective stack at runtime
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveStackRenderer.java32
1 files changed, 17 insertions, 15 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveStackRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveStackRenderer.java
index 05add977b..dedc919e0 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveStackRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveStackRenderer.java
@@ -261,23 +261,25 @@ public abstract class BasePerspectiveStackRenderer<N, I, IC> extends BaseRendere
void handleSelectedElement(MPerspectiveStack parent, MPerspective oldElement, MPerspective newElement) {
hideElementRecursive(oldElement);
- WPerspectiveStack<N, I, IC> stack = getWidget(parent);
- int idx = 0;
- for (WStackItem<I, IC> i : stack.getItems()) {
- if (i.getDomElement() == newElement) {
- stack.selectItem(idx);
- // TODO Should we do the traversal before???
- showElementRecursive(newElement);
- return;
+ if( newElement != null ) {
+ WPerspectiveStack<N, I, IC> stack = getWidget(parent);
+ int idx = 0;
+ for (WStackItem<I, IC> i : stack.getItems()) {
+ if (i.getDomElement() == newElement) {
+ stack.selectItem(idx);
+ // TODO Should we do the traversal before???
+ showElementRecursive(newElement);
+ return;
+ }
+ idx++;
}
- idx++;
+
+ // Looks like the child is not part of the UI yet (most likely because it got removed using IPR#removeGUI)
+ childRendered(parent, newElement);
+ stack.selectItem(parent.getChildren().indexOf(newElement));
+ // TODO Should we do the traversal before???
+ showElementRecursive(newElement);
}
-
- // Looks like the child is not part of the UI yet (most likely because it got removed using IPR#removeGUI)
- childRendered(parent, newElement);
- stack.selectItem(parent.getChildren().indexOf(newElement));
- // TODO Should we do the traversal before???
- showElementRecursive(newElement);
}
boolean handleStackItemClose(MPerspective e, WStackItem<I, IC> item) {

Back to the top