Fix sources list of one source throws an exception (#308)

This commit is contained in:
Mitchell Syer
2022-03-20 11:54:09 -04:00
committed by GitHub
parent 44ffed3f7c
commit a27af0b642
2 changed files with 4 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ object GetCatalogueSource {
}
fun getCatalogueSourceOrStub(sourceId: Long): CatalogueSource {
return getCatalogueSource(sourceId) ?: StubSource(sourceId)
return runCatching { getCatalogueSource(sourceId) }.getOrNull() ?: StubSource(sourceId)
}
fun registerCatalogueSource(sourcePair: Pair<Long, CatalogueSource>) {