0
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden synced 2024-12-16 02:23:49 +01:00

Fix bug where secureNotes is empty (#4730)

This commit is contained in:
Coby Geralnik 2024-07-10 23:13:55 +03:00 committed by GitHub
parent 6fedfceaa9
commit a4ab014ade
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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});
}