From 358955dd134ab0d4809a4fbe61c7fd04a91f2124 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Mon, 30 Aug 2010 17:07:50 +0000 Subject: [PATCH] Bug 323996: Avoid potential NPE --- .../gdb/launching/FinalLaunchSequence.java | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java index 0d4994a2a94..8947b514c97 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java @@ -65,39 +65,31 @@ public class FinalLaunchSequence extends Sequence { }}, /* - * Fetch the GDBBackend service for later use + * Fetch the GDBBackend, CommandControl and Process services for later use */ new Step() { @Override public void execute(RequestMonitor requestMonitor) { fGDBBackend = fTracker.getService(IGDBBackend.class); if (fGDBBackend == null) { requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain GDBBackend service", null)); //$NON-NLS-1$ + requestMonitor.done(); + return; } - requestMonitor.done(); - }}, - /* - * Fetch the control service for later use - */ - new Step() { @Override - public void execute(RequestMonitor requestMonitor) { fCommandControl = fTracker.getService(IGDBControl.class); if (fCommandControl == null) { requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain control service", null)); //$NON-NLS-1$ + requestMonitor.done(); + return; } fCommandFactory = fCommandControl.getCommandFactory(); - requestMonitor.done(); - }}, - /* - * Fetch the process service for later use - */ - new Step() { @Override - public void execute(RequestMonitor requestMonitor) { fProcService = fTracker.getService(IMIProcesses.class); if (fProcService == null) { requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain process service", null)); //$NON-NLS-1$ + requestMonitor.done(); + return; } requestMonitor.done();