Skip to content

Commit e0eb1a9

Browse files
author
Guille Gonzalez
authored
Fix hang when trying to load invalid image (#113)
1 parent a42676a commit e0eb1a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/MarkdownUI/Rendering/NSAttributedString+ImageLoading.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ extension NSAttributedString {
3131
}
3232
}
3333

34+
guard !imageAttachmentPublishers.isEmpty else {
35+
return Just(attributedString).eraseToAnyPublisher()
36+
}
37+
3438
return Publishers.MergeMany(imageAttachmentPublishers)
3539
.collect()
3640
.map { Dictionary($0, uniquingKeysWith: { _, last in last }) }

0 commit comments

Comments
 (0)