diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt index 6c9f715e2..e9509faaa 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt @@ -16,7 +16,7 @@ import com.x8bit.bitwarden.ui.platform.base.util.toHexColorRepresentation fun UserStateJson.toUpdatedUserStateJson( syncResponse: SyncResponseJson, ): UserStateJson { - val userId = syncResponse.profile?.id ?: return this + val userId = syncResponse.profile.id val account = this.accounts[userId] ?: return this val profile = account.profile // TODO: Update additional missing UserStateJson properties (BIT-916) diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/SyncResponseJson.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/SyncResponseJson.kt index 091f50864..dee3d39ee 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/SyncResponseJson.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/SyncResponseJson.kt @@ -10,7 +10,7 @@ import java.time.LocalDateTime * * @property folders A list of folders associated with the vault data (nullable). * @property collections A list of collections associated with the vault data (nullable). - * @property profile The profile associated with the vault data (nullable). + * @property profile The profile associated with the vault data. * @property ciphers A list of ciphers associated with the vault data (nullable). * @property policies A list of policies associated with the vault data (nullable). * @property domains A domains object associated with the vault data. @@ -25,7 +25,7 @@ data class SyncResponseJson( val collections: List?, @SerialName("profile") - val profile: Profile?, + val profile: Profile, @SerialName("ciphers") val ciphers: List?, diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt index 4ec209472..775f8973a 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt @@ -312,7 +312,7 @@ class VaultRepositoryImpl constructor( private fun storeKeys( syncResponse: SyncResponseJson, ) { - val profile = syncResponse.profile ?: return + val profile = syncResponse.profile val userId = profile.id val userKey = profile.key val privateKey = profile.privateKey @@ -338,7 +338,7 @@ class VaultRepositoryImpl constructor( private suspend fun unlockVaultForOrganizationsIfNecessary( syncResponse: SyncResponseJson, ) { - val profile = syncResponse.profile ?: return + val profile = syncResponse.profile val organizationKeys = profile.organizations .orEmpty() .filter { it.key != null }