diff --git a/KILabel/Source/KILabel.m b/KILabel/Source/KILabel.m index b32b882..d4a64d1 100644 --- a/KILabel/Source/KILabel.m +++ b/KILabel/Source/KILabel.m @@ -881,6 +881,10 @@ + (NSString *)linkStringFromAttributedString:(NSAttributedString *)attrStr withR { // Check to see if there's a link attribute in the text, which will be our link text. If not // we'll use the string in the raw text. + if (range.location == NSNotFound || range.location >= attrStr.length) { + return @""; + } + id realURL = [attrStr attribute:NSLinkAttributeName atIndex:range.location effectiveRange:nil]; if (realURL == nil) {