Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2014-05-09 05:09:29 -0400
committerAnton Leherbauer2014-05-09 05:09:29 -0400
commitc634b81fe6f5a58a86c84b81665d9e063cee1c22 (patch)
tree8d9cb88da1f48fcccb1316ae2f47fef18d5da16f
parent2e02e6d9183791cad801cb9bffc37efff857095e (diff)
downloadorg.eclipse.tcf-c634b81fe6f5a58a86c84b81665d9e063cee1c22.tar.gz
org.eclipse.tcf-c634b81fe6f5a58a86c84b81665d9e063cee1c22.tar.xz
org.eclipse.tcf-c634b81fe6f5a58a86c84b81665d9e063cee1c22.zip
Terminal: Fix exception from property tester on shutdown
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/PropertyTester.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/PropertyTester.java
index b8384e230..053b040bb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/PropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/PropertyTester.java
@@ -35,14 +35,22 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
}
if ("hasDisconnectButton".equals(property) && receiver instanceof CTabItem) { //$NON-NLS-1$
- Boolean hasDisconnectButton = (Boolean)((CTabItem)receiver).getData(ITerminalsConnectorConstants.PROP_HAS_DISCONNECT_BUTTON);
- return expectedValue.equals(hasDisconnectButton);
+ CTabItem tabItem = (CTabItem)receiver;
+ if (!tabItem.isDisposed()) {
+ Boolean hasDisconnectButton = (Boolean) tabItem.getData(ITerminalsConnectorConstants.PROP_HAS_DISCONNECT_BUTTON);
+ return expectedValue.equals(hasDisconnectButton);
+ }
+ return false;
}
- if ("canDisconnect".equals(property) && receiver instanceof CTabItem && ((CTabItem)receiver).getData() instanceof ITerminalViewControl) { //$NON-NLS-1$
- ITerminalViewControl terminal = (ITerminalViewControl)((CTabItem)receiver).getData();
- TerminalState state = terminal.getState();
- return expectedValue.equals(Boolean.valueOf(state != TerminalState.CLOSED));
+ if ("canDisconnect".equals(property) && receiver instanceof CTabItem) { //$NON-NLS-1$
+ CTabItem tabItem = (CTabItem)receiver;
+ if (!tabItem.isDisposed() && tabItem.getData() instanceof ITerminalViewControl) {
+ ITerminalViewControl terminal = (ITerminalViewControl)tabItem.getData();
+ TerminalState state = terminal.getState();
+ return expectedValue.equals(Boolean.valueOf(state != TerminalState.CLOSED));
+ }
+ return false;
}
return false;

Back to the top