Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/LaunchBarManager.java2
-rw-r--r--launch/org.eclipse.cdt.launchbar.ui/src/org/eclipse/cdt/launchbar/ui/internal/controls/ConfigSelector.java7
2 files changed, 7 insertions, 2 deletions
diff --git a/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/LaunchBarManager.java b/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/LaunchBarManager.java
index edf57176706..5a1d410e3dc 100644
--- a/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/LaunchBarManager.java
+++ b/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/LaunchBarManager.java
@@ -430,7 +430,7 @@ public class LaunchBarManager extends PlatformObject implements ILaunchBarManage
@Override
public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException {
- if (activeLaunchDesc == null)
+ if (activeLaunchDesc == null || target == null)
return null;
Map<String, ILaunchConfigurationProvider> targetMap = configProviders.get(descriptor.getType().getId());
diff --git a/launch/org.eclipse.cdt.launchbar.ui/src/org/eclipse/cdt/launchbar/ui/internal/controls/ConfigSelector.java b/launch/org.eclipse.cdt.launchbar.ui/src/org/eclipse/cdt/launchbar/ui/internal/controls/ConfigSelector.java
index 2b0a4ddbeca..e6857822d55 100644
--- a/launch/org.eclipse.cdt.launchbar.ui/src/org/eclipse/cdt/launchbar/ui/internal/controls/ConfigSelector.java
+++ b/launch/org.eclipse.cdt.launchbar.ui/src/org/eclipse/cdt/launchbar/ui/internal/controls/ConfigSelector.java
@@ -30,6 +30,7 @@ import org.eclipse.debug.core.ILaunchMode;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
import org.eclipse.debug.ui.ILaunchGroup;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
@@ -146,12 +147,16 @@ public class ConfigSelector extends CSelector {
@Override
public void handleEdit(Object element) {
try {
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
ILaunchDescriptor desc = (ILaunchDescriptor) element;
ILaunchMode mode = getManager().getActiveLaunchMode();
ILaunchTarget target = getManager().getActiveLaunchTarget();
+ if (target == null) {
+ MessageDialog.openError(shell, "No Active Target", "You must create a target to edit this launch configuration.");
+ return;
+ }
ILaunchConfigurationType configType = getManager().getLaunchConfigurationType(desc, target);
ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier());
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(group.getIdentifier());
if (groupExt != null) {
ILaunchConfiguration config = getManager().getLaunchConfiguration(desc, target);

Back to the top