mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 11:48:24 +00:00
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D93heBmNF3dPZwNmBHbH8k
This commit is contained in:
+1
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user