Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Dushistova2014-02-19 01:00:17 -0500
committerGerrit Code Review @ Eclipse.org2014-02-19 01:08:31 -0500
commitf0659ce461d0b3743f3e61811f09fb3929395e3c (patch)
tree00d7c850f0b805fa279cbffa2b83df4444ac1abe
parentff9a3748226fa8ec75b5b08a246a510fd089e746 (diff)
downloadorg.eclipse.tcf-f0659ce461d0b3743f3e61811f09fb3929395e3c.tar.gz
org.eclipse.tcf-f0659ce461d0b3743f3e61811f09fb3929395e3c.tar.xz
org.eclipse.tcf-f0659ce461d0b3743f3e61811f09fb3929395e3c.zip
[Bug 428475] Fixed NPE.
Signed-off-by: Anna Dushistova <anna.dushistova@gmail.com>
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java
index 53f28f5f2..f41c66e8e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java
@@ -17,6 +17,7 @@ import org.eclipse.tcf.te.launch.ui.model.LaunchModel;
import org.eclipse.tcf.te.launch.ui.model.LaunchNode;
import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
import org.eclipse.tcf.te.ui.swt.DisplayUtil;
+import org.eclipse.tcf.te.ui.trees.TreeControl;
import org.eclipse.tcf.te.ui.views.editor.Editor;
import org.eclipse.tcf.te.ui.views.editor.EditorInput;
import org.eclipse.ui.IEditorInput;
@@ -56,9 +57,13 @@ public class EditorHandlerDelegate implements IEditorHandlerDelegate {
IFormPage page = formEditor.setActivePage("org.eclipse.tcf.te.launch.ui.LaunchEditorPage"); //$NON-NLS-1$
// If the element is a context node, select the node
if (page != null && element instanceof LaunchModel || element instanceof LaunchNode) {
- Viewer viewer = ((LaunchExplorerEditorPage)page).getTreeControl().getViewer();
- if (viewer != null) {
- viewer.setSelection(new StructuredSelection(element), true);
+ TreeControl treeControl = ((LaunchExplorerEditorPage) page)
+ .getTreeControl();
+ if (treeControl != null) {
+ Viewer viewer = treeControl.getViewer();
+ if (viewer != null) {
+ viewer.setSelection(new StructuredSelection(element), true);
+ }
}
}
else if (page == null && formEditor instanceof Editor) {

Back to the top