Bug 553343

Summary: FileDialog can crash in open() with NPE
Product: [Eclipse Project] Platform Reporter: Stephan Aßmus <superstippi>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.9   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Stephan Aßmus CLA 2019-11-22 05:18:13 EST
We received a crashlog from a user where org.eclipse.swt.widgets.FileDialog.open() crashed on line 347 (SWT 4.9). These are the lines in question:

346:  OS.beginSheetModalForWindow(panel, parent.view.window(), handler);
347:  NSApplication.sharedApplication().runModalForWindow(parent.view.window());

It is unclear which of the variables have a null value. But "parent" and "parent.view" have both been non-null in the line directly above. NSApplication.sharedApplication() may return null.

Before you dismiss this bug, since it is for an older version of SWT, please check whether the situation is actually any different in this part of the code. The version of macOS on the user's machine was 10.13.6.

I've checked the possible duplicates for this bug, they seem unrelated.