8000 [file_selector] Ignore empty accept group lists on macOS (#837) · google/flutter-desktop-embedding@a0ecd05 · GitHub
[go: up one dir, main page]

Skip to content

Commit a0ecd05

Browse files
[file_selector] Ignore empty accept group lists on macOS (#837)
The null safety migration for file_selector defaults the accept group to an empty set rather than null, so empty set needs to be treated as no filter. That's already the case for Windows and Linux; this makes macOS consistent with that.
1 parent 7daa15e commit a0ecd05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/file_selector/file_selector_macos/macos/Classes/FLEFileSelectorPlugin.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ - (void)configureSavePanel:(nonnull NSSavePanel *)panel
5656
panel.directoryURL = [NSURL URLWithString:initialDirectory];
5757
}
5858
NSArray<NSDictionary<NSString*, id>*>* acceptedTypeGroups = GetNonNullValueForKey(arguments, kAcceptedTypeGroupsKey);
59-
if (acceptedTypeGroups) {
59+
if (acceptedTypeGroups.count > 0) {
6060
// macOS doesn't support filter groups, so combine all allowed types into a flat list.
6161
NSMutableArray<NSString *> *allowedTypes = [NSMutableArray array];
6262
for (NSDictionary *filter in acceptedTypeGroups) {

0 commit comments

Comments
 (0)
0