Skip to content

Commit 82bf8f2

Browse files
committed
Extra safety check when rendering comment attachment with illegal size
1 parent 9ed111b commit 82bf8f2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Aztec/Classes/Renderers/CommentAttachmentRenderer.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ extension CommentAttachmentRenderer: TextViewAttachmentImageProvider {
4343
return nil
4444
}
4545

46+
// Extra safety check to avoid crash when attempting to render image with size smaller than 0
47+
guard size.width > 0 && size.height > 0 else {
48+
return nil
49+
}
50+
4651
UIGraphicsBeginImageContextWithOptions(size, false, 0)
4752

4853
let message = messageAttributedString()

0 commit comments

Comments
 (0)