From cd94f99f6076eb3ae816e4a78e55dfe35f3df458 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Tue, 23 Feb 2021 15:33:03 -0500 Subject: [PATCH] error check. --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 8838966c..3d57d0aa 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -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)