From e1d592c130e5106a5828e3532e8eb69610c0ddc8 Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Thu, 1 Mar 2007 13:29:01 +0000 Subject: [PATCH] Fix NPE when creating a config when no project is selected. --- .../src/org/eclipse/cdt/launch/ui/CMainTab.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java index 56f50cd78fc..8612c258d53 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java @@ -277,7 +277,9 @@ public class CMainTab extends CLaunchConfigurationTab { * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ public void performApply(ILaunchConfigurationWorkingCopy config) { - config.setMappedResources(new IResource[] { this.getCProject().getProject() }); + ICProject cProject = this.getCProject(); + if (cProject != null) + config.setMappedResources(new IResource[] { cProject.getProject() }); config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText()); config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText()); if (fTerminalButton != null) {