Changeset 109497 in webkit


Ignore:
Timestamp:
Mar 1, 2012 8:54:18 PM (12 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/10942540> REGRESSION (r108956): Safari Webpage Preview Fetcher crashes in WebCore::localizedString() when using a WebKit nightly build
https://bugs.webkit.org/show_bug.cgi?id=80034

Reviewed by Benjamin Poulain.

Safari Webpage Preview Fetcher can’t access the WebCore framework when launched from a WebKit
nightly build. After r108956, this causes it to crash.

  • platform/mac/LocalizedStringsMac.cpp:

(WebCore::localizedString): Added a null-check for the value returned from
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebCore")).

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109494 r109497  
     12012-03-01  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/10942540> REGRESSION (r108956): Safari Webpage Preview Fetcher crashes in WebCore::localizedString() when using a WebKit nightly build
     4        https://bugs.webkit.org/show_bug.cgi?id=80034
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Safari Webpage Preview Fetcher can’t access the WebCore framework when launched from a WebKit
     9        nightly build. After r108956, this causes it to crash.
     10
     11        * platform/mac/LocalizedStringsMac.cpp:
     12        (WebCore::localizedString): Added a null-check for the value returned from
     13        CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebCore")).
     14
    1152012-03-01  Jason Liu  <jason.liu@torchmobile.com.cn>
    216
  • trunk/Source/WebCore/platform/mac/LocalizedStringsMac.cpp

    r108956 r109497  
    4747    RetainPtr<CFStringRef> keyString(AdoptCF, CFStringCreateWithCStringNoCopy(0, key, kCFStringEncodingUTF8, kCFAllocatorNull));
    4848    CFStringRef notFound = CFSTR("localized string not found");
    49     RetainPtr<CFStringRef> result(AdoptCF, CFBundleCopyLocalizedString(bundle, keyString.get(), notFound, 0));
     49    RetainPtr<CFStringRef> result;
     50    if (bundle) {
     51        result.adoptCF(CFBundleCopyLocalizedString(bundle, keyString.get(), notFound, 0));
     52        ASSERT_WITH_MESSAGE(result.get() != notFound, "could not find localizable string %s in bundle", key);
     53    } else
     54        result = notFound;
    5055
    51     ASSERT_WITH_MESSAGE(result.get() != notFound, "could not find localizable string %s in bundle", key);
    5256    return String(result.get());
    5357}
Note: See TracChangeset for help on using the changeset viewer.