Skip to content

Commit 1989d41

Browse files
basilevsHeikoKlare
authored andcommitted
Fix NPE #1929
This is a fixup for ab1d119 The contract of `openDialog()` is to throw on error, and return Optional of user action. Null return value is not expected.
1 parent 7ae22a9 commit 1989d41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public Optional<String> openDialog () {
195195
directoryPath = null;
196196
panel = NSOpenPanel.openPanel();
197197
if (panel == null) {
198-
return null;
198+
throw new SWTException(SWT.ERROR_INVALID_RETURN_VALUE);
199199
}
200200

201201
callback_performKeyEquivalent = new Callback(this, "_performKeyEquivalent", 3);

0 commit comments

Comments
 (0)