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() {