Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit bde37ac

Browse files
committed
Merge pull request #1089 from Adlai-Holler/TextNodeIgnoreEmptyStringReplace
[ASTextNode] Ignore Setting Text to Nil When Text Is Already Empty
2 parents 7f1ac58 + db18724 commit bde37ac

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

AsyncDisplayKit/ASTextNode.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,14 +336,14 @@ - (BOOL)_needInvalidateRenderer:(CGSize)newSize
336336

337337
- (void)setAttributedString:(NSAttributedString *)attributedString
338338
{
339-
if (ASObjectIsEqual(attributedString, _attributedString)) {
340-
return;
341-
}
342-
343339
if (attributedString == nil) {
344340
attributedString = [[NSAttributedString alloc] initWithString:@"" attributes:nil];
345341
}
346342

343+
if (ASObjectIsEqual(attributedString, _attributedString)) {
344+
return;
345+
}
346+
347347
_attributedString = ASCleanseAttributedStringOfCoreTextAttributes(attributedString);
348348

349349
// Sync the truncation string with attributes from the updated _attributedString

0 commit comments

Comments
 (0)