diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeTargetActionProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeTargetActionProvider.java index a7eb22687da..444626cfa98 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeTargetActionProvider.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeTargetActionProvider.java @@ -97,13 +97,15 @@ public class MakeTargetActionProvider extends CommonActionProvider { public void setContext(ActionContext context) { super.setContext(context); - IStructuredSelection selection = (IStructuredSelection) context.getSelection(); - editTargetAction.selectionChanged(selection); - copyTargetAction.selectionChanged(selection); - pasteTargetAction.selectionChanged(selection); - deleteTargetAction.selectionChanged(selection); - buildTargetAction.selectionChanged(selection); - buildLastTargetAction.selectionChanged(selection); + if (context != null) { + IStructuredSelection selection = (IStructuredSelection) context.getSelection(); + editTargetAction.selectionChanged(selection); + copyTargetAction.selectionChanged(selection); + pasteTargetAction.selectionChanged(selection); + deleteTargetAction.selectionChanged(selection); + buildTargetAction.selectionChanged(selection); + buildLastTargetAction.selectionChanged(selection); + } } }