Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2015-01-27 15:11:18 -0500
committerEugene Tarassov2015-01-27 15:11:18 -0500
commit5a1aa66534537bc2eda3a0dbfdd06835dd02f533 (patch)
tree7334db7476ec85ab47810274730d9877fb81a43f
parente6bfca79ca9cd80e1a3869a79235bfb26d0e1c69 (diff)
downloadorg.eclipse.tcf-5a1aa66534537bc2eda3a0dbfdd06835dd02f533.tar.gz
org.eclipse.tcf-5a1aa66534537bc2eda3a0dbfdd06835dd02f533.tar.xz
org.eclipse.tcf-5a1aa66534537bc2eda3a0dbfdd06835dd02f533.zip
TCF Debugger: fixed NPE when debugger fails to open TCF channel because of an error
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
index d46c88191..8c4409f5c 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
@@ -876,18 +876,20 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
locks.clear();
for (TCFSnapshot s : arr) s.dispose();
}
- IMemory mem = launch.getService(IMemory.class);
- if (mem != null) mem.removeListener(mem_listener);
- IRunControl run = launch.getService(IRunControl.class);
- if (run != null) run.removeListener(run_listener);
- IMemoryMap mmap = launch.getService(IMemoryMap.class);
- if (mmap != null) mmap.removeListener(mmap_listener);
- IPathMap pmap = launch.getService(IPathMap.class);
- if (pmap != null) pmap.removeListener(pmap_listener);
- IRegisters reg = launch.getService(IRegisters.class);
- if (reg != null) reg.removeListener(reg_listener);
- IProcesses prs = launch.getService(IProcesses.class);
- if (prs != null) prs.removeListener(prs_listener);
+ if (launch.getChannel() != null) {
+ IMemory mem = launch.getService(IMemory.class);
+ if (mem != null) mem.removeListener(mem_listener);
+ IRunControl run = launch.getService(IRunControl.class);
+ if (run != null) run.removeListener(run_listener);
+ IMemoryMap mmap = launch.getService(IMemoryMap.class);
+ if (mmap != null) mmap.removeListener(mmap_listener);
+ IPathMap pmap = launch.getService(IPathMap.class);
+ if (pmap != null) pmap.removeListener(pmap_listener);
+ IRegisters reg = launch.getService(IRegisters.class);
+ if (reg != null) reg.removeListener(reg_listener);
+ IProcesses prs = launch.getService(IProcesses.class);
+ if (prs != null) prs.removeListener(prs_listener);
+ }
if (launch_node != null) {
launch_node.dispose();
launch_node = null;

Back to the top