diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VoucherDialogViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VoucherDialogViewModel.kt index 802245bb1d46..3691fc79b5a4 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VoucherDialogViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VoucherDialogViewModel.kt @@ -60,9 +60,7 @@ class VoucherDialogViewModel( when (val result = serviceConnectionManager.voucherRedeemer()?.submit(voucherCode)) { is VoucherSubmissionResult.Ok -> handleAddedTime(result.submission.timeAdded) is VoucherSubmissionResult.Error -> setError(result.error) - else -> { - vmState.update { VoucherDialogState.Default } - } + null -> vmState.update { VoucherDialogState.Default } } } } @@ -88,7 +86,8 @@ class VoucherDialogViewModel( when (error) { VoucherSubmissionError.InvalidVoucher -> R.string.invalid_voucher VoucherSubmissionError.VoucherAlreadyUsed -> R.string.voucher_already_used - else -> R.string.error_occurred + VoucherSubmissionError.RpcError, + VoucherSubmissionError.OtherError -> R.string.error_occurred } ) vmState.update { VoucherDialogState.Error(message) } diff --git a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/persistence/SplitTunnelingPersistence.kt b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/persistence/SplitTunnelingPersistence.kt index 264304ab3f67..055c9f8777cd 100644 --- a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/persistence/SplitTunnelingPersistence.kt +++ b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/persistence/SplitTunnelingPersistence.kt @@ -29,9 +29,6 @@ class SplitTunnelingPersistence(context: Context) { } private fun loadExcludedApps(): Set { - return when { - appListFile.exists() -> appListFile.readLines().toSet() - else -> emptySet() - } + return if (appListFile.exists()) appListFile.readLines().toSet() else emptySet() } }