fix(opml): ignore default group non-null check for service accounts when export (#655)

This commit is contained in:
Ash 2024-03-22 01:07:55 +08:00 committed by GitHub
parent 90859947ac
commit dfcba9c246
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ class OpmlService @Inject constructor(
*/
@Throws(Exception::class)
suspend fun saveToString(accountId: Int, attachInfo: Boolean): String {
val defaultGroup = groupDao.queryById(getDefaultGroupId(accountId))!!
val defaultGroup = groupDao.queryById(getDefaultGroupId(accountId))
return OpmlWriter().write(
Opml(
"2.0",
@ -78,7 +78,7 @@ class OpmlService @Inject constructor(
"title" to it.group.name,
).apply {
if (attachInfo) {
put("isDefault", (it.group.id == defaultGroup.id).toString())
put("isDefault", (it.group.id == defaultGroup?.id).toString())
}
},
it.feeds.map { feed ->