Fix iOS Simulator Release test crashes.
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2018 17:48:59 +0000 (17:48 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2018 17:48:59 +0000 (17:48 +0000)
* platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::adjustMIMETypeIfNecessary): Check for null before using the
new MIME type.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238801 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm

index 953a769..9a8fa60 100644 (file)
@@ -1,3 +1,11 @@
+2018-12-03  Dean Jackson  <dino@apple.com>
+
+        Fix iOS Simulator Release test crashes.
+
+        * platform/network/ios/WebCoreURLResponseIOS.mm:
+        (WebCore::adjustMIMETypeIfNecessary): Check for null before using the
+        new MIME type.
+
 2018-12-03  Eric Carlson  <eric.carlson@apple.com>
 
         [MediaStream] 'devicechange' event when more capture device information are revealed.
index 0509ed6..00b5ab2 100644 (file)
@@ -71,7 +71,8 @@ void adjustMIMETypeIfNecessary(CFURLResponseRef cfResponse, bool isMainResourceL
                 CFMutableStringRef mutableExtension = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, extension.get());
                 CFStringLowercase(mutableExtension, NULL);
                 extension = adoptCF(mutableExtension);
-                updatedMIMEType = (CFStringRef)CFDictionaryGetValue(extensionMap, extension.get());
+                if (auto newMIMEType = (CFStringRef)CFDictionaryGetValue(extensionMap, extension.get()))
+                    updatedMIMEType = newMIMEType;
             }
         }
     }