From 9254bff03463f2e1afb82201c295743e622e2c85 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 17 Sep 2026 19:10:01 +0000 Subject: [PATCH] fix(commons): drop unnecessary non-null assertion in vaultDelete K2 propagates the `contents != null` implication carried by the `removedFromVault` local val, so the `!!` inside the `if (removedFromVault)` branch is redundant and the compiler warns on it. The `encodeVault(contents)` call in the same branch already relied on that smart cast. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01D93heBmNF3dPZwNmBHbH8k --- .../amethyst/commons/keystorage/SecureKeyStorage.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/src/jvmMain/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorage.kt b/commons/src/jvmMain/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorage.kt index 926135932f..c817d7f6ef 100644 --- a/commons/src/jvmMain/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorage.kt +++ b/commons/src/jvmMain/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorage.kt @@ -441,7 +441,7 @@ actual class SecureKeyStorage private actual constructor() { } if (removedFromVault) { - if (contents!!.isEmpty()) { + if (contents.isEmpty()) { try { keyring().deletePassword(SERVICE_NAME, vaultAlias) } catch (_: PasswordAccessException) {