From 3c182b8cf9968bd0830f4dfdeca7013e488e2cd6 Mon Sep 17 00:00:00 2001 From: John Cortell Date: Tue, 29 Jun 2010 18:11:44 +0000 Subject: [PATCH] Bug 317707: Fixed NPE during shutdown --- .../org/eclipse/cdt/ui/actions/DeleteResConfigsHandler.java | 2 +- .../org/eclipse/cdt/ui/actions/ExcludeFromBuildHandler.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsHandler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsHandler.java index f357874ac59..6d17235e3b7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsHandler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsHandler.java @@ -79,7 +79,7 @@ public class DeleteResConfigsHandler extends AbstractHandler { public void setEnabledFromSelection(ISelection selection) { objects = null; - if (!selection.isEmpty()) { + if ((selection != null) && !selection.isEmpty()) { // case for context menu Object[] obs = null; if (selection instanceof IStructuredSelection) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildHandler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildHandler.java index 443a02c048f..6c329d662a8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildHandler.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ExcludeFromBuildHandler.java @@ -83,7 +83,7 @@ public class ExcludeFromBuildHandler extends AbstractHandler { cfgNames = null; boolean cfgsOK = true; - if (!selection.isEmpty()) { + if ((selection != null) && !selection.isEmpty()) { // case for context menu Object[] obs = null; if (selection instanceof IStructuredSelection) { @@ -142,7 +142,7 @@ public class ExcludeFromBuildHandler extends AbstractHandler { } } } - setBaseEnabled(cfgsOK && objects != null ); + setBaseEnabled(cfgsOK && (objects != null)); } private IFile getFileFromActiveEditor() {