Skip to content

Commit

Permalink
File dialog should throw error instead of returning null
Browse files Browse the repository at this point in the history
  • Loading branch information
kysmith-csg authored and HeikoKlare committed Jul 17, 2024
1 parent 0db6253 commit 51e85e0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public Optional<String> openDialog () {
fullPath = null;
if ((style & SWT.SAVE) != 0) {
NSSavePanel savePanel = NSSavePanel.savePanel();
if (savePanel == null) return null;
if (savePanel == null) error(SWT.ERROR_INVALID_RETURN_VALUE);
panel = savePanel;
if (!overwrite) {
callback_overwrite_existing_file = new Callback(this, "_overwriteExistingFileCheck", 3);
Expand All @@ -395,7 +395,7 @@ public Optional<String> openDialog () {
}
} else {
NSOpenPanel openPanel = NSOpenPanel.openPanel();
if (openPanel == null) return null;
if (openPanel == null) error(SWT.ERROR_INVALID_RETURN_VALUE);
openPanel.setAllowsMultipleSelection((style & SWT.MULTI) != 0);
panel = openPanel;
}
Expand Down

0 comments on commit 51e85e0

Please sign in to comment.