Changeset 157648 in webkit


Ignore:
Timestamp:
Oct 18, 2013 2:09:11 PM (11 years ago)
Author:
mitz@apple.com
Message:

[Cocoa] WKBrowsingController accessors crash instead of returning nil
https://bugs.webkit.org/show_bug.cgi?id=123036

Reviewed by Anders Carlsson.

  • UIProcess/API/mac/WKBrowsingContextController.mm:

(autoreleased): Return nil if the object is NULL.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r157643 r157648  
     12013-10-18  Dan Bernstein  <mitz@apple.com>
     2
     3        [Cocoa] WKBrowsingController accessors crash instead of returning nil
     4        https://bugs.webkit.org/show_bug.cgi?id=123036
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * UIProcess/API/mac/WKBrowsingContextController.mm:
     9        (autoreleased): Return nil if the object is NULL.
     10
    1112013-10-18  Anders Carlsson  <andersca@apple.com>
    212
  • trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm

    r154963 r157648  
    5050static inline NSString *autoreleased(WKStringRef string)
    5151{
    52     return CFBridgingRelease(WKStringCopyCFString(kCFAllocatorDefault, adoptWK(string).get()));
     52    return string ? CFBridgingRelease(WKStringCopyCFString(kCFAllocatorDefault, adoptWK(string).get())) : nil;
    5353}
    5454
    5555static inline NSURL *autoreleased(WKURLRef url)
    5656{
    57     return CFBridgingRelease(WKURLCopyCFURL(kCFAllocatorDefault, adoptWK(url).get()));
     57    return url ? CFBridgingRelease(WKURLCopyCFURL(kCFAllocatorDefault, adoptWK(url).get())) : nil;
    5858}
    5959
Note: See TracChangeset for help on using the changeset viewer.