Skip to content

Commit

Permalink
guard UTTypeCopyAllTagsWithClass on 10.9-
Browse files Browse the repository at this point in the history
  • Loading branch information
blueboxd committed Nov 5, 2023
1 parent f4cbdc8 commit 9eb7d35
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions net/base/platform_mime_util_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,14 @@ - (NSArray*)extensionsForMIMEType:(NSString*)mimeType;
nullptr));
if (types) {
for (CFIndex i = 0; i < CFArrayGetCount(types); i++) {
base::apple::ScopedCFTypeRef<CFArrayRef> extensions_list(
UTTypeCopyAllTagsWithClass(base::apple::CFCast<CFStringRef>(
CFArrayGetValueAtIndex(types, i)),
kUTTagClassFilenameExtension));
base::apple::ScopedCFTypeRef<CFArrayRef> extensions_list;
if (@available(macOS 10.10, *)) {
extensions_list.reset(
UTTypeCopyAllTagsWithClass(
base::apple::CFCast<CFStringRef>(
CFArrayGetValueAtIndex(types, i)),
kUTTagClassFilenameExtension));
}
if (!extensions_list) {
continue;
}
Expand Down

0 comments on commit 9eb7d35

Please sign in to comment.