diff --git a/atom/browser/ui/file_dialog_mac.mm b/atom/browser/ui/file_dialog_mac.mm index 676c632a2a44..49662c69b3b8 100644 --- a/atom/browser/ui/file_dialog_mac.mm +++ b/atom/browser/ui/file_dialog_mac.mm @@ -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,