ui: Fix crash on empty path in Cocoa file select dialog

This commit is contained in:
Matt Borgerson 2020-03-26 00:17:47 -07:00
parent bfc3783d9f
commit 60199805e6
1 changed files with 1 additions and 1 deletions

View File

@ -242,7 +242,7 @@ const char *noc_file_dialog_open(int flags,
[open_panel setCanChooseFiles:NO];
}
if (default_path) {
if (default_path && (strlen(default_path) > 0)) {
default_url = [NSURL fileURLWithPath:
[NSString stringWithUTF8String:default_path]];
[panel setDirectoryURL:default_url];