From 8c518b15d3b3b2b2bdad398da896e8b3495fc7c0 Mon Sep 17 00:00:00 2001 From: John Cortell Date: Tue, 11 Mar 2008 20:40:32 +0000 Subject: [PATCH] Avoid a NPE when we receive a TERMINATE event for an IProcess that was not created with a launch configuration (at a minimum, JDT creates such a thing in StandardVMType.java, a process called "Library Detection"). --- .../org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java index 97011351429..66e803c82ff 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java @@ -19,6 +19,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.IDebugEventSetListener; +import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.model.IProcess; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.swt.widgets.Shell; @@ -210,7 +211,10 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements IDebugEventSetLi IProcess proc = (IProcess)o; ICProject cproject = null; try { - cproject = AbstractCLaunchDelegate.getCProject(proc.getLaunch().getLaunchConfiguration()); + ILaunchConfiguration launchConfig = proc.getLaunch().getLaunchConfiguration(); + if (launchConfig != null) { + cproject = AbstractCLaunchDelegate.getCProject(launchConfig); + } } catch (CoreException e) { } if (cproject != null) {