Skip to content

Commit

Permalink
Find/replace overlay: avoid attempt to set focus while disposing overlay
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
HeikoKlare committed Oct 3, 2024
1 parent ef8188e commit e37086d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ public void setForeground(Color color) {

@Override
public boolean forceFocus() {
return textBar.forceFocus();
if (!textBar.isDisposed()) {
return textBar.forceFocus();
}
return false;
}

@Override
Expand Down

0 comments on commit e37086d

Please sign in to comment.