diff --git a/iphone/Maps/Categories/NSAttributedString+HTML.swift b/iphone/Maps/Categories/NSAttributedString+HTML.swift index c4d426ae68..aa9a26a24e 100644 --- a/iphone/Maps/Categories/NSAttributedString+HTML.swift +++ b/iphone/Maps/Categories/NSAttributedString+HTML.swift @@ -68,8 +68,8 @@ extension NSMutableAttributedString { func enumerateAttachments(estimatedWidth: CGFloat) { enumerateAttribute(.attachment, in: NSMakeRange(0, length), options: []) { (value, range, _) in - if let attachement = value as? NSTextAttachment { - let image = attachement.image(forBounds: attachement.bounds, textContainer: NSTextContainer(), characterIndex: range.location)! + if let attachement = value as? NSTextAttachment, + let image = attachement.image(forBounds: attachement.bounds, textContainer: NSTextContainer(), characterIndex: range.location) { if image.size.width > estimatedWidth { let newImage = resizeImage(image: image, scale: estimatedWidth/image.size.width) ?? image let resizedAttachment = NSTextAttachment()