 
     fileprivate func detectAttachmentRemoved(in range:NSRange) {
         textStore.enumerateAttachmentsOfType(TextAttachment.self, range: range) { (attachment, range, stop) in
-            self.attachmentsDelegate?.storage(self, deletedAttachmentWithID: attachment.identifier)
+            self.attachmentsDelegate.storage(self, deletedAttachmentWithID: attachment.identifier)
         }
     }
 


    // MARK: - Attachments

    var attachmentsDelegate: TextStorageAttachmentsDelegate?

    open func TextAttachments() -> [TextAttachment] {
        let range = NSMakeRange(0, length)

        onSuccess success: @escaping (UIImage) -> (),
        onFailure failure: @escaping () -> ()) -> UIImage
    {
        assert(attachmentsDelegate != nil)
        return attachmentsDelegate.storage(self, attachment: textAttachment, imageForURL: url, onSuccess: success, onFailure: failure)
    }

