[webkit-changes] [WebKit/WebKit] 4d5195: Add null check in WebCore::toNSDictionary

Alex Christensen noreply at github.com
Sat Apr 1 23:43:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4d5195db6f803dbdd779175730954660a9bb96a6
      https://github.com/WebKit/WebKit/commit/4d5195db6f803dbdd779175730954660a9bb96a6
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2023-04-01 (Sat, 01 Apr 2023)

  Changed paths:
    M Source/WebCore/editing/cocoa/AttributedString.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/NSAttributedStringWebKitAdditions.mm

  Log Message:
  -----------
  Add null check in WebCore::toNSDictionary
https://bugs.webkit.org/show_bug.cgi?id=254876
rdar://107516455

Unreviewed.

Sometimes, such as decoding an NSFont that is from a web font,
we get a null NSObject.  Rather than trying to add it to the
NSDictionary of attributes and throwing an ObjC exception, null
check the object before trying.

* Source/WebCore/editing/cocoa/AttributedString.mm:
(WebCore::toNSDictionary):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/NSAttributedStringWebKitAdditions.mm:
(TEST):

Canonical link: https://commits.webkit.org/262490@main




More information about the webkit-changes mailing list