diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt index 60c42afbd4e..544ac6b3e8b 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt @@ -17,6 +17,7 @@ import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.merge @@ -122,6 +123,7 @@ class VaultDiskSourceImpl( override fun getDomains(userId: String): Flow = domainsDao .getDomains(userId) + .filterNotNull() .map { entity -> withContext(dispatcherManager.default) { json.decodeFromString(entity.domainsJson) diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/dao/DomainsDao.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/dao/DomainsDao.kt index a5977cb26b2..bec92cd0dd1 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/dao/DomainsDao.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/dao/DomainsDao.kt @@ -25,7 +25,7 @@ interface DomainsDao { @Query("SELECT * FROM domains WHERE user_id = :userId") fun getDomains( userId: String, - ): Flow + ): Flow /** * Inserts domains into the database.