Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-05-28 03:06:03 -0400
committerUwe Stieber2013-05-28 10:17:40 -0400
commit06181de18bb8065d094478fa3b1695ac6f828e9c (patch)
tree9ac780e10b1f5ac0ba32c0d4af1773d5ac3ed650
parent75d0d127b256e4e034d4389c207bd16c78dee33b (diff)
downloadorg.eclipse.tcf-06181de18bb8065d094478fa3b1695ac6f828e9c.tar.gz
org.eclipse.tcf-06181de18bb8065d094478fa3b1695ac6f828e9c.tar.xz
org.eclipse.tcf-06181de18bb8065d094478fa3b1695ac6f828e9c.zip
Target Explorer: fix possible npe
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEventListener.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEventListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEventListener.java
index 0e83899ad..2fb043fa8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEventListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEventListener.java
@@ -45,23 +45,24 @@ public class ProcessMonitorEventListener extends AbstractEventListener {
final ChangeEvent changeEvent = (ChangeEvent)event;
final Object source = changeEvent.getSource();
- // Property changes for the runtime model refreshes the whole tree.
- if (source instanceof IRuntimeModel) {
- treeControl.getViewer().refresh();
- }
+ if (treeControl.getViewer() != null) {
+ // Property changes for the runtime model refreshes the whole tree.
+ if (source instanceof IRuntimeModel) {
+ treeControl.getViewer().refresh();
+ }
- // Property changes for individual context nodes refreshes the node only
- else if (source instanceof IProcessContextNode) {
- if ("expanded".equals(changeEvent.getEventId())) { //$NON-NLS-1$
- // Expansion state of the node changed.
- boolean expanded = ((Boolean)changeEvent.getNewValue()).booleanValue();
- // Update the nodes expansion state
- ((TreeViewer)treeControl.getViewer()).setExpandedState(source, expanded);
- } else {
- ((TreeViewer)treeControl.getViewer()).refresh(source, true);
+ // Property changes for individual context nodes refreshes the node only
+ else if (source instanceof IProcessContextNode) {
+ if ("expanded".equals(changeEvent.getEventId())) { //$NON-NLS-1$
+ // Expansion state of the node changed.
+ boolean expanded = ((Boolean)changeEvent.getNewValue()).booleanValue();
+ // Update the nodes expansion state
+ ((TreeViewer)treeControl.getViewer()).setExpandedState(source, expanded);
+ } else {
+ ((TreeViewer)treeControl.getViewer()).refresh(source, true);
+ }
}
}
}
}
-
}

Back to the top