Skip to content

Commit

Permalink
Handling null pointer on non-Mac systems. #118
Browse files Browse the repository at this point in the history
  • Loading branch information
a2geek committed Oct 28, 2023
1 parent 7819a0c commit 6deb104
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ protected Shell open(Display display) {
Display.setAppName(textBundle.get("SwtAppleCommander.AppleCommander")); //$NON-NLS-1$
// Find the system About menu on Mac OS X.
// See https://www.eclipse.org/swt/R3_7/new_and_noteworthy.html#m6
for (MenuItem item : display.getSystemMenu().getItems()) {
if (item.getID() == SWT.ID_ABOUT) {
item.addSelectionListener(widgetSelectedAdapter(e -> showAboutAppleCommander()));
if (display.getSystemMenu() != null) {
for (MenuItem item : display.getSystemMenu().getItems()) {
if (item.getID() == SWT.ID_ABOUT) {
item.addSelectionListener(widgetSelectedAdapter(e -> showAboutAppleCommander()));
}
}
}
shell = new Shell(display, SWT.BORDER | SWT.CLOSE | SWT.MIN | SWT.TITLE);
Expand Down

0 comments on commit 6deb104

Please sign in to comment.