From db18724d5b5e451cb5908ebd151d73a49314166c Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Wed, 20 Jan 2016 14:00:46 -0800 Subject: [PATCH] If they set attributedString to nil twice, ignore the second one. --- AsyncDisplayKit/ASTextNode.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AsyncDisplayKit/ASTextNode.mm b/AsyncDisplayKit/ASTextNode.mm index 9ad5437b59..7eac0593dc 100644 --- a/AsyncDisplayKit/ASTextNode.mm +++ b/AsyncDisplayKit/ASTextNode.mm @@ -336,14 +336,14 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (void)setAttributedString:(NSAttributedString *)attributedString { - if (ASObjectIsEqual(attributedString, _attributedString)) { - return; - } - if (attributedString == nil) { attributedString = [[NSAttributedString alloc] initWithString:@"" attributes:nil]; } + if (ASObjectIsEqual(attributedString, _attributedString)) { + return; + } + _attributedString = ASCleanseAttributedStringOfCoreTextAttributes(attributedString); // Sync the truncation string with attributes from the updated _attributedString