Skip to content

Commit

Permalink
Fix NPE.
Browse files Browse the repository at this point in the history
  • Loading branch information
albertus82 committed May 19, 2024
1 parent 31c55bb commit 50332d6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;

import lombok.NonNull;
import lombok.RequiredArgsConstructor;
Expand All @@ -19,7 +20,10 @@ public class ExitListener extends ShellAdapter implements SelectionListener, Lis
private final IShellProvider shellProvider;

private void disposeAll() {
shellProvider.getShell().dispose();
final Shell shell = shellProvider.getShell();
if (shell != null) {
shell.dispose();
}
final Display display = Display.getCurrent();
if (display != null) {
display.dispose(); // Fix close not working on Windows 10 when iconified
Expand Down

0 comments on commit 50332d6

Please sign in to comment.