mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add comment on why checking empty set
This commit is contained in:
@@ -35,11 +35,12 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
|
||||
}
|
||||
}
|
||||
|
||||
// Passing empty array to setAllowedFileTypes will cause exception.
|
||||
NSArray* file_types = nil;
|
||||
if ([file_type_set count])
|
||||
file_types = [file_type_set allObjects];
|
||||
|
||||
[dialog setAllowedFileTypes: file_types];
|
||||
[dialog setAllowedFileTypes:file_types];
|
||||
}
|
||||
|
||||
void SetupDialog(NSSavePanel* dialog,
|
||||
|
||||
Reference in New Issue
Block a user