         return finalString
     }
 
-    fileprivate func detectAttachmentRemoved(in range:NSRange) {
+    fileprivate func detectAttachmentRemoved(in range: NSRange) {
+        // Ref. #727:
+        // If the delegate is not set, we *Explicitly* do not want to crash here.
+        //
+        guard let delegate = attachmentsDelegate else {
+            return
+        }
+
         textStore.enumerateAttachmentsOfType(MediaAttachment.self, range: range) { (attachment, range, stop) in
-            self.attachmentsDelegate.storage(self, deletedAttachmentWith: attachment.identifier)
+            delegate.storage(self, deletedAttachmentWith: attachment.identifier)
         }
     }
 

        return attachments
    }

    func range<T : NSTextAttachment>(for attachment: T) -> NSRange? {
        var range: NSRange?


    /// - Returns: the preprocessed string.
    ///
    fileprivate func preprocessAttachmentsForInsertion(_ attributedString: NSAttributedString) -> NSAttributedString {
        // Ref. #727:
        // If the delegate is not set, we *Explicitly* do not want to crash here.
        //
        guard let delegate = attachmentsDelegate else {
            return attributedString
        }

        let fullRange = NSRange(location: 0, length: attributedString.length)
        let finalString = NSMutableAttributedString(attributedString: attributedString)
