From 9eb7d35a0b8000d33c04ae51d7d6b1d799271b33 Mon Sep 17 00:00:00 2001 From: blueboxd <48254131+blueboxd@users.noreply.github.com> Date: Mon, 6 Nov 2023 00:35:27 +0900 Subject: [PATCH] guard UTTypeCopyAllTagsWithClass on 10.9- --- net/base/platform_mime_util_mac.mm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/net/base/platform_mime_util_mac.mm b/net/base/platform_mime_util_mac.mm index 6ca45512611247..a564e65c53f5ec 100644 --- a/net/base/platform_mime_util_mac.mm +++ b/net/base/platform_mime_util_mac.mm @@ -177,10 +177,14 @@ - (NSArray*)extensionsForMIMEType:(NSString*)mimeType; nullptr)); if (types) { for (CFIndex i = 0; i < CFArrayGetCount(types); i++) { - base::apple::ScopedCFTypeRef extensions_list( - UTTypeCopyAllTagsWithClass(base::apple::CFCast( - CFArrayGetValueAtIndex(types, i)), - kUTTagClassFilenameExtension)); + base::apple::ScopedCFTypeRef extensions_list; + if (@available(macOS 10.10, *)) { + extensions_list.reset( + UTTypeCopyAllTagsWithClass( + base::apple::CFCast( + CFArrayGetValueAtIndex(types, i)), + kUTTagClassFilenameExtension)); + } if (!extensions_list) { continue; }