         onSuccess success: @escaping (UIImage) -> (),
         onFailure failure: @escaping () -> ())
     {
-        assert(attachmentsDelegate != nil)
-        attachmentsDelegate.storage(self, attachment: mediaAttachment, imageFor: url, onSuccess: success, onFailure: failure)
+        guard let delegate = attachmentsDelegate else {
+            fatalError()
+        }
+
+        delegate.storage(self, attachment: mediaAttachment, imageFor: url, onSuccess: success, onFailure: failure)
     }
 }
 

extension TextStorage: RenderableAttachmentDelegate {

    func attachment(_ attachment: NSTextAttachment, imageForSize size: CGSize) -> UIImage? {
        assert(attachmentsDelegate != nil)
        return attachmentsDelegate.storage(self, imageFor: attachment, with: size)
    }

    func attachment(_ attachment: NSTextAttachment, boundsForLineFragment fragment: CGRect) -> CGRect {
        assert(attachmentsDelegate != nil)
        return attachmentsDelegate.storage(self, boundsFor: attachment, with: fragment)
    }
}

extension TextStorage: MediaAttachmentDelegate {

    func mediaAttachmentPlaceholderImageFor(attachment: MediaAttachment) -> UIImage {
        guard let delegate = attachmentsDelegate else {
            fatalError()
        }

        return delegate.storage(self, placeholderFor: attachment)
    }

    func mediaAttachment(
