ensuring the range passed in is valid.
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
b021e14030
commit
5b4358e9e9
@ -418,7 +418,7 @@ extension Label {
|
|||||||
|
|
||||||
/// Underlines the tappable region and stores the tap logic for interation.
|
/// Underlines the tappable region and stores the tap logic for interation.
|
||||||
private func setTextLinkState(range: NSRange, actionBlock: @escaping ActionBlock) {
|
private func setTextLinkState(range: NSRange, actionBlock: @escaping ActionBlock) {
|
||||||
guard range.length > 0 else { return }
|
guard let text, text.isValid(range: range) else { return }
|
||||||
|
|
||||||
var textLink = ActionLabelAttribute(location: range.location, length: range.length)
|
var textLink = ActionLabelAttribute(location: range.location, length: range.length)
|
||||||
textLink.subscriber = textLink
|
textLink.subscriber = textLink
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user