check length

This commit is contained in:
Kevin G Christiano 2020-10-06 10:30:37 -04:00
parent e8cdbd804e
commit 7c636a00b1

View File

@ -257,7 +257,7 @@ public typealias ActionBlock = () -> ()
* Only other reference found of issue: https://www.thetopsites.net/article/58142205.shtml
*/
if #available(iOS 13, *) {
if let attributedText = attributedText, let text = text {
if let attributedText = attributedText, let text = text, !text.isEmpty {
let attributedString = NSMutableAttributedString(string: text)
let range = NSRange(location: 0, length: text.count)
for attribute in attributedText.attributes(at: 0, effectiveRange: nil) {