From 6888fe93b8455a10516db2d8586dcda405d3811d Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 20 Mar 2024 15:23:34 -0500 Subject: [PATCH] ensuring the range passed in is valid. Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index adc88cb4..fa71def6 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -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