🍎 fix #3864 where saving a file causes a crash if file extension array is empty
This commit is contained in:
parent
d4de4505b8
commit
ba26a4b4e6
1 changed files with 6 additions and 1 deletions
|
@ -34,7 +34,12 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
|
|||
[file_type_set addObject:base::mac::CFToNSCast(ext_cf.get())];
|
||||
}
|
||||
}
|
||||
[dialog setAllowedFileTypes:[file_type_set allObjects]];
|
||||
|
||||
NSArray* file_types = nil;
|
||||
if ([file_type_set count])
|
||||
file_types = [file_type_set allObjects];
|
||||
|
||||
[dialog setAllowedFileTypes: file_types];
|
||||
}
|
||||
|
||||
void SetupDialog(NSSavePanel* dialog,
|
||||
|
|
Loading…
Reference in a new issue