             }
             
         } else {
-            if let selectedLinkRangeResult = selectedLinkRangeResult, attributedText = attributedText {
-                self.attributedText = addLinkAttributesToAttributedString(attributedText, withLinkRangeResults: [selectedLinkRangeResult], highlighted: false)
+            if let selectedLinkRangeResult = selectedLinkRangeResult {
+                attributedText = addLinkAttributesToAttributedString(attributedText, withLinkRangeResults: [selectedLinkRangeResult], highlighted: false)
             }
             
             selectedLinkRangeResult = nil

                attributes = attributesWithTextColor(color)
            }
            
            if let attributes = attributes {
                let location = text.startIndex.distanceTo(linkRangeResult.linkRange.startIndex)
                let length = linkRangeResult.linkRange.startIndex.distanceTo(linkRangeResult.linkRange.endIndex)
                let range = NSMakeRange(location, length)
                
                mutableAttributedString.setAttributes(attributes, range: range)
            }
        }
        

    }
    
    // linkDetectionTypes
    var linkDetectionTypes: LinkDetectionType = .UserHandle | .Hashtag | .URL | .TextLink {
        didSet {
            setContextLabelDataWithText(nil)
        }
