From: Cheng Zhao Date: Thu, 31 Dec 2015 10:58:16 +0000 (+0800) Subject: Add comment on why checking empty set X-Git-Tag: v0.36.3~28 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=8aced2c31eb796df291ef336a099e82b870c1396;p=electron.git Add comment on why checking empty set --- diff --git a/atom/browser/ui/file_dialog_mac.mm b/atom/browser/ui/file_dialog_mac.mm index 676c632a..49662c69 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,