Skip to content

Commit 7e1f3a9

Browse files
committed
Avoid NPE from find/replace overlay when closing workbench
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.
1 parent 08d06f9 commit 7e1f3a9

File tree

1 file changed

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

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,16 @@ private void toggleToolItem(ToolItem toolItem) {
221221
private ControlListener shellMovementListener = new ControlListener() {
222222
@Override
223223
public void controlMoved(ControlEvent e) {
224-
getShell().getDisplay().asyncExec(() -> positionToPart());
224+
if (getShell() != null) {
225+
getShell().getDisplay().asyncExec(() -> positionToPart());
226+
}
225227
}
226228

227229
@Override
228230
public void controlResized(ControlEvent e) {
229-
getShell().getDisplay().asyncExec(() -> positionToPart());
231+
if (getShell() != null) {
232+
getShell().getDisplay().asyncExec(() -> positionToPart());
233+
}
230234
}
231235
};
232236

0 commit comments

Comments
 (0)