mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 15:38:28 +02:00
Check nullability on attributed text
This commit is contained in:
@@ -167,11 +167,16 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3;
|
||||
|
||||
- (void)setAttributedTextMessage:(NSAttributedString *)attributedTextMessage
|
||||
{
|
||||
NSMutableAttributedString *mutableTextMessage = [[NSMutableAttributedString alloc] initWithAttributedString:attributedTextMessage];
|
||||
[mutableTextMessage addAttributes:@{ NSForegroundColorAttributeName: ThemeService.shared.theme.textPrimaryColor,
|
||||
NSFontAttributeName: self.textDefaultFont }
|
||||
range:NSMakeRange(0, mutableTextMessage.length)];
|
||||
self.textView.attributedText = mutableTextMessage;
|
||||
if (attributedTextMessage)
|
||||
{
|
||||
NSMutableAttributedString *mutableTextMessage = [[NSMutableAttributedString alloc] initWithAttributedString:attributedTextMessage];
|
||||
[mutableTextMessage addAttributes:@{ NSForegroundColorAttributeName: ThemeService.shared.theme.textPrimaryColor,
|
||||
NSFontAttributeName: self.textDefaultFont }
|
||||
range:NSMakeRange(0, mutableTextMessage.length)];
|
||||
attributedTextMessage = mutableTextMessage;
|
||||
}
|
||||
|
||||
self.textView.attributedText = attributedTextMessage;
|
||||
[self updateUIWithAttributedTextMessage:attributedTextMessage animated:YES];
|
||||
[self textViewDidChange:self.textView];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user