error check.
This commit is contained in:
parent
8a861077dd
commit
cd94f99f60
@ -836,7 +836,10 @@ extension Label {
|
||||
|
||||
fileprivate func setActionAttributes(range: NSRange) {
|
||||
|
||||
guard let attributedText = attributedText else { return }
|
||||
guard let attributedText = attributedText,
|
||||
range.length > 0,
|
||||
range.length <= attributedText.length
|
||||
else { return }
|
||||
|
||||
let mutableAttributedString = NSMutableAttributedString(attributedString: attributedText)
|
||||
addActionAttributes(range: range, string: mutableAttributedString)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user