Skip to content

Commit e37086d

Browse files
committed
Find/replace overlay: avoid attempt to set focus while disposing overlay
When closing a find/replace overlay, the SWT dispose operations try to set focus to some remaining widget. The HistoryTextWrapper tries to pass this operation to the contained Text widget without validating it for already being disposed (which is the case when closing the overlay), thus potentially leading to exception. This change ensures that before trying to set focus on the Text widget of a HistoryTextWrapper that widget is validated for not being disposed.
1 parent ef8188e commit e37086d

File tree

1 file changed

+4
-1
lines changed
  • bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay

1 file changed

+4
-1
lines changed

bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/HistoryTextWrapper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ public void setForeground(Color color) {
192192

193193
@Override
194194
public boolean forceFocus() {
195-
return textBar.forceFocus();
195+
if (!textBar.isDisposed()) {
196+
return textBar.forceFocus();
197+
}
198+
return false;
196199
}
197200

198201
@Override

0 commit comments

Comments
 (0)