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 91a6b8fe5..cdb1e1235 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 @@ -124,6 +125,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 a5977cb26..bec92cd0d 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.