From 90cede5f449321dde894c004001a48fa1f566d13 Mon Sep 17 00:00:00 2001 From: Vasili Gulevich Date: Thu, 27 Mar 2025 22:48:33 +0400 Subject: [PATCH] Fix NPE #1929 This is a fixup for ab1d11972aab1c75149f271dca4b58ccfd7710a7 The contract of `openDialog()` is to throw on error, and return Optional of user action. Null return value is not expected. --- .../cocoa/org/eclipse/swt/widgets/DirectoryDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java index 1cf25d6ce45..4df7269f17c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java @@ -195,7 +195,7 @@ public Optional openDialog () { directoryPath = null; panel = NSOpenPanel.openPanel(); if (panel == null) { - return null; + throw new SWTException(SWT.ERROR_INVALID_RETURN_VALUE); } callback_performKeyEquivalent = new Callback(this, "_performKeyEquivalent", 3);