improvement: Decrypt empty string as empty string
This commit is contained in:
parent
f6fbc9da7f
commit
5ea143bdb9
|
@ -87,6 +87,11 @@ fun BitwardenCrCta.transformString(
|
||||||
encoder(env.key).invoke(encryptionType, data)
|
encoder(env.key).invoke(encryptionType, data)
|
||||||
},
|
},
|
||||||
isDecrypt = {
|
isDecrypt = {
|
||||||
|
// This should never happen, but just in case to not
|
||||||
|
// fail the decryption process we fall back to an empty string.
|
||||||
|
if (value.isEmpty()) {
|
||||||
|
return@whatIf value
|
||||||
|
}
|
||||||
val data = decoder(env.key).invoke(value).data
|
val data = decoder(env.key).invoke(value).data
|
||||||
String(data)
|
String(data)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue