Skip to content

Commit 5bf06a9

Browse files
committed
Fix bridging in both if branches.
1 parent f06240d commit 5bf06a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Foundation/NSAttributedString.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ internal func _NSReadMutableAttributedStringWithCoder(_ decoder: NSCoder, mutabl
588588
let attributes = decoder.decodeObject(of: allowed, forKey: "NSAttributes")
589589
// If this is present, 'attributes' should be an array; otherwise, a dictionary:
590590
let attrData = decoder.decodeObject(of: NSData.self, forKey: "NSAttributeInfo")
591-
if attrData == nil, let attributes = attributes as? [NSAttributedString.Key : Any] {
591+
if attrData == nil, let attributesNS = attributes as? NSDictionary, let attributes = toAttributesDictionary(attributesNS) {
592592
mutableAttributedString.setAttributes(attributes, range: NSMakeRange(0, string.length))
593593
return true
594594
} else if let attrData = attrData, let attributesNS = attributes as? [NSDictionary] {

0 commit comments

Comments
 (0)