aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian de Alwis2011-08-20 12:40:29 (EDT)
committerPaul Webster2011-08-25 10:22:04 (EDT)
commit72329906ce9d57061bc244bfb47490ca5877c9ca (patch)
tree1d650134f84886f7ef577f1f0d95f73f6dbcfa23
parent0dcdf1bb355c25ca0114d3598c26a4d5ca49280b (diff)
downloadeclipse.platform.ui-72329906ce9d57061bc244bfb47490ca5877c9ca.zip
eclipse.platform.ui-72329906ce9d57061bc244bfb47490ca5877c9ca.tar.gz
eclipse.platform.ui-72329906ce9d57061bc244bfb47490ca5877c9ca.tar.bz2
Bring in fix for #353625: NPE in AbstractWindowHandler.canExecute()
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/AbstractWindowHandler.java2
-rw-r--r--bundles/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/AbstractWindowHandler.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/AbstractWindowHandler.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/AbstractWindowHandler.java
index 9fd6e0b..b724667 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/AbstractWindowHandler.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/AbstractWindowHandler.java
@@ -26,7 +26,7 @@ public abstract class AbstractWindowHandler {
@CanExecute
public boolean canExecute(
@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
- if (shell == null) {
+ if (shell == null || shell.view == null) {
return false;
}
NSWindow window = shell.view.window();
diff --git a/bundles/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/AbstractWindowHandler.java b/bundles/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/AbstractWindowHandler.java
index eed3d10..3972a05 100644
--- a/bundles/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/AbstractWindowHandler.java
+++ b/bundles/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/AbstractWindowHandler.java
@@ -26,7 +26,7 @@ public abstract class AbstractWindowHandler extends AbstractHandler {
public boolean isEnabled() {
boolean enabled = false;
Shell activeShell = Display.getDefault().getActiveShell();
- if(activeShell !=null) {
+ if (activeShell != null && activeShell.view != null) {
NSWindow window = activeShell.view.window();
if(window!=null)
enabled = !window.isMiniaturized();