Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2015-04-08 11:01:00 +0000
committerUwe Stieber2015-04-08 11:01:00 +0000
commit80cb45a366088b3ce835296613314f487c1e210f (patch)
treeb0c539c9cbf7aff79299f43a26d40a32d56f300c
parente699e3620082d243671cbcc2666f71e87a7a29c9 (diff)
downloadorg.eclipse.tcf-80cb45a366088b3ce835296613314f487c1e210f.tar.gz
org.eclipse.tcf-80cb45a366088b3ce835296613314f487c1e210f.tar.xz
org.eclipse.tcf-80cb45a366088b3ce835296613314f487c1e210f.zip
Target Explorer: Fix potential NPE's in debug service
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
index b220bbd75..9d0c5b76d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
@@ -237,12 +237,15 @@ public class DebugService extends AbstractService implements IDebugService {
if (context instanceof IModelNode) {
ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
for (ILaunch launch : launches) {
+ if (launch == null) continue;
try {
- if (launch.getLaunchConfiguration().getType().getIdentifier().equals(ILaunchTypes.ATTACH) && !launch.isTerminated()) {
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launch.getLaunchConfiguration());
- if (contexts != null && contexts.length == 1 && contexts[0].equals(context)) {
- isLaunched = true;
- break;
+ if (launch.getLaunchConfiguration() != null && launch.getLaunchConfiguration().getType() != null && launch.getLaunchConfiguration().getType().getIdentifier() != null) {
+ if (launch.getLaunchConfiguration().getType().getIdentifier().equals(ILaunchTypes.ATTACH) && !launch.isTerminated()) {
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launch.getLaunchConfiguration());
+ if (contexts != null && contexts.length == 1 && contexts[0].equals(context)) {
+ isLaunched = true;
+ break;
+ }
}
}
} catch (CoreException e) {

Back to the top