Skip to content

Commit f323d2c

Browse files
committed
Fix crash on exporting feeds with no alternate links
1 parent f4b3a2f commit f323d2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/kotlin/feeds/FeedsModel.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class FeedsModel(
177177
text = feed.title,
178178
outlines = emptyList(),
179179
xmlUrl = feed.links.first { it.rel is AtomLinkRel.Self }.href.toString(),
180-
htmlUrl = feed.links.first { it.rel is AtomLinkRel.Alternate }.href.toString(),
180+
htmlUrl = feed.links.firstOrNull { it.rel is AtomLinkRel.Alternate }?.href?.toString(),
181181
extOpenEntriesInBrowser = feed.ext_open_entries_in_browser,
182182
extShowPreviewImages = feed.ext_show_preview_images,
183183
extBlockedWords = feed.ext_blocked_words,
@@ -189,7 +189,7 @@ class FeedsModel(
189189
outlines = outlines,
190190
)
191191

192-
withContext(Dispatchers.Default) {
192+
withContext(Dispatchers.IO) {
193193
out.write(opmlDocument.toXmlDocument().toPrettyString().toByteArray())
194194
}
195195
}

0 commit comments

Comments
 (0)