         onSuccess success: @escaping (UIImage) -> (),
         onFailure failure: @escaping () -> ()) -> UIImage
     {
-        guard let attachmentsDelegate = attachmentsDelegate else {
-            fatalError("This class doesn't really support not having an attachments delegate set.")
-        }
-        
+        assert(attachmentsDelegate != nil)
         return attachmentsDelegate.storage(self, attachment: textAttachment, imageForURL: url, onSuccess: success, onFailure: failure)
     }
 

    /// - Returns: the preprocessed string.
    ///
    fileprivate func preprocessAttachmentsForInsertion(_ attributedString: NSAttributedString) -> NSAttributedString {
        
        let fullRange = NSRange(location: 0, length: attributedString.length)
        let finalString = NSMutableAttributedString(attributedString: attributedString)
        
        attributedString.enumerateAttribute(NSAttachmentAttributeName, in: fullRange, options: []) { (object, range, stop) in

            guard let object = object, !(object is LineAttachment), !(object is CommentAttachment) else {
                return
            }

            guard let attachmentsDelegate = attachmentsDelegate else {
                assertionFailure("This class can't really handle not having an image provider set.")
                return
            }



    // MARK: - Attachments

    var attachmentsDelegate: TextStorageAttachmentsDelegate!

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