1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 01:05:38 +02:00

Bug 323996: Avoid potential NPE

This commit is contained in:
Marc Khouzam 2010-08-30 17:07:50 +00:00
parent 2475fe0010
commit 358955dd13

View file

@ -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 new Step() { @Override
public void execute(RequestMonitor requestMonitor) { public void execute(RequestMonitor requestMonitor) {
fGDBBackend = fTracker.getService(IGDBBackend.class); fGDBBackend = fTracker.getService(IGDBBackend.class);
if (fGDBBackend == null) { if (fGDBBackend == null) {
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain GDBBackend service", null)); //$NON-NLS-1$ 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); fCommandControl = fTracker.getService(IGDBControl.class);
if (fCommandControl == null) { if (fCommandControl == null) {
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain control service", null)); //$NON-NLS-1$ requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain control service", null)); //$NON-NLS-1$
requestMonitor.done();
return;
} }
fCommandFactory = fCommandControl.getCommandFactory(); 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); fProcService = fTracker.getService(IMIProcesses.class);
if (fProcService == null) { if (fProcService == null) {
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain process service", null)); //$NON-NLS-1$ requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain process service", null)); //$NON-NLS-1$
requestMonitor.done();
return;
} }
requestMonitor.done(); requestMonitor.done();