Skip to content

Commit

Permalink
Fix nullability conversion warning
Browse files Browse the repository at this point in the history
Explicitly cast or provide a fallback value
  • Loading branch information
mrackwitz committed Dec 29, 2015
1 parent 3814505 commit 934c39a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Components/MRProgressOverlayView.m
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
NSStringFromClass(self.class));
#endif
} else {
self.titleLabelText = (id)[[NSAttributedString alloc] initWithString:self.titleLabel.text attributes:_savedAttributes];
NSString *plainText = self.titleLabel.text;
NSString *_Nonnull text = plainText ? (NSString *_Nonnull)plainText : @"";
self.titleLabelText = (id)[[NSAttributedString alloc] initWithString:text attributes:_savedAttributes];
_savedAttributes = nil;
}
}
Expand Down

0 comments on commit 934c39a

Please sign in to comment.