From 005c6ad956076086c798ac5d4a6489b7cd0b4d17 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Fri, 22 Nov 2002 01:58:17 +0000 Subject: [PATCH] Check the project exists() or isOpen(). --- .../cdt/launch/AbstractCLaunchDelegate.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java index 281248548f3..5ba808792fb 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java @@ -197,11 +197,17 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel if (name == null) { abort("C project not specified", null, ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT); } - ICProject project = getCProject(config); - if (project == null) { - abort("Project does not exist or is not a C/C++ project", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); + ICProject cproject = getCProject(config); + if (cproject == null) { + IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); + if (!project.exists()) { + abort("Project does not exist", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); + } else if (!project.isOpen()) { + abort("Project is closed", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); + } + abort("Project is not a C/C++ project", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); } - return project; + return cproject; } protected IPath verifyProgramFile(ILaunchConfiguration config) throws CoreException {