Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
index a455dc855..3078a2464 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
@@ -6215,8 +6215,12 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
@Override
public void setFocus() {
- if (fSourceViewer != null && fSourceViewer.getTextWidget() != null)
- fSourceViewer.getTextWidget().setFocus();
+ if (fSourceViewer != null) {
+ StyledText widget= fSourceViewer.getTextWidget();
+ if (widget != null && !widget.isDisposed()) {
+ widget.setFocus();
+ }
+ }
}
@Override

Back to the top