ensuring the range passed in is valid.

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-03-20 15:23:34 -05:00
parent 0a8e8ad98d
commit 6888fe93b8

View File

@ -421,8 +421,8 @@ extension Label {
/// Underlines the tappable region and stores the tap logic for interation.
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)
textLink.subscriber = textLink
.action