Skip to content

Commit

Permalink
Avoid NPE from find/replace overlay when closing workbench
Browse files Browse the repository at this point in the history
A missing null check when performing an asynchronous execution on the
display of the find/replace overlay's shell leads to a
NullPointerException at least when closing a workbench. This change adds
an according null check.
  • Loading branch information
HeikoKlare committed Jul 4, 2024
1 parent 08d06f9 commit 7e1f3a9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,16 @@ private void toggleToolItem(ToolItem toolItem) {
private ControlListener shellMovementListener = new ControlListener() {
@Override
public void controlMoved(ControlEvent e) {
getShell().getDisplay().asyncExec(() -> positionToPart());
if (getShell() != null) {
getShell().getDisplay().asyncExec(() -> positionToPart());
}
}

@Override
public void controlResized(ControlEvent e) {
getShell().getDisplay().asyncExec(() -> positionToPart());
if (getShell() != null) {
getShell().getDisplay().asyncExec(() -> positionToPart());
}
}
};

Expand Down

0 comments on commit 7e1f3a9

Please sign in to comment.