Skip to content

Commit

Permalink
Fix hang when trying to load invalid image (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guille Gonzalez authored Jul 22, 2022
1 parent a42676a commit e0eb1a9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ extension NSAttributedString {
}
}

guard !imageAttachmentPublishers.isEmpty else {
return Just(attributedString).eraseToAnyPublisher()
}

return Publishers.MergeMany(imageAttachmentPublishers)
.collect()
.map { Dictionary($0, uniquingKeysWith: { _, last in last }) }
Expand Down

0 comments on commit e0eb1a9

Please sign in to comment.