mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
If they set attributedString to nil twice, ignore the second one.
This commit is contained in:
@@ -336,14 +336,14 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
|||||||
|
|
||||||
- (void)setAttributedString:(NSAttributedString *)attributedString
|
- (void)setAttributedString:(NSAttributedString *)attributedString
|
||||||
{
|
{
|
||||||
if (ASObjectIsEqual(attributedString, _attributedString)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attributedString == nil) {
|
if (attributedString == nil) {
|
||||||
attributedString = [[NSAttributedString alloc] initWithString:@"" attributes:nil];
|
attributedString = [[NSAttributedString alloc] initWithString:@"" attributes:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ASObjectIsEqual(attributedString, _attributedString)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_attributedString = ASCleanseAttributedStringOfCoreTextAttributes(attributedString);
|
_attributedString = ASCleanseAttributedStringOfCoreTextAttributes(attributedString);
|
||||||
|
|
||||||
// Sync the truncation string with attributes from the updated _attributedString
|
// Sync the truncation string with attributes from the updated _attributedString
|
||||||
|
|||||||
Reference in New Issue
Block a user