Skip to content

Commit

Permalink
Fix bug where secureNotes is empty (#4730)
Browse files Browse the repository at this point in the history
  • Loading branch information
cobyge authored Jul 10, 2024
1 parent 6fedfce commit a4ab014
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/db/models/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}

Expand Down

0 comments on commit a4ab014

Please sign in to comment.