summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoby Geralnik <[email protected]>2024-07-10 23:13:55 +0300
committerGitHub <[email protected]>2024-07-10 22:13:55 +0200
commita4ab014ade53e4e60bda0b9cbce3af9de7eac753 (patch)
tree4d59afda3a21e76b29b85792a1f988b75ad960bb
parent6fedfceaa9d43f14a4c65695a42b42b095659b42 (diff)
downloadvaultwarden-a4ab014ade53e4e60bda0b9cbce3af9de7eac753.tar.gz
vaultwarden-a4ab014ade53e4e60bda0b9cbce3af9de7eac753.zip
Fix bug where secureNotes is empty (#4730)
-rw-r--r--src/db/models/cipher.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/db/models/cipher.rs b/src/db/models/cipher.rs
index 446749d4..c9b29c9e 100644
--- a/src/db/models/cipher.rs
+++ b/src/db/models/cipher.rs
@@ -189,9 +189,11 @@ impl Cipher {
}
}
- // Fix secure note issues when data is `{}`
+ // Fix secure note issues when data is invalid
// This breaks at least the native mobile clients
- if self.atype == 2 && (self.data.eq("{}") || self.data.to_ascii_lowercase().eq("{\"type\":null}")) {
+ if self.atype == 2
+ && (self.data.is_empty() || self.data.eq("{}") || self.data.to_ascii_lowercase().eq("{\"type\":null}"))
+ {
type_data_json = json!({"type": 0});
}