diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-04-17 02:25:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 02:25:53 -0400 |
commit | 2ac44755bce30709abccd05210eb86ba1e18ce84 (patch) | |
tree | 039414af9db4a0dd659eeaedb2f18464013b9b9f /src | |
parent | 7e7cb24a1edcd5395469b04a5852b94eb82f2f88 (diff) | |
parent | 0960f21fefa25befa7f671bee62f8ba22e0923ab (diff) | |
download | rbw-2ac44755bce30709abccd05210eb86ba1e18ce84.tar.gz rbw-2ac44755bce30709abccd05210eb86ba1e18ce84.zip |
Merge pull request #51 from simias/dev/fixpasshistory
Don't choke on empty passwords in the history
Diffstat (limited to 'src')
-rw-r--r-- | src/api.rs | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -252,14 +252,18 @@ impl SyncResCipher { let history = if let Some(history) = &self.password_history { history .iter() - .map(|entry| crate::db::HistoryEntry { - last_used_date: entry.last_used_date.clone(), - password: entry.password.clone(), + .filter_map(|entry| { + // Gets rid of entries with a non-existent password + entry.password.clone().map(|p| crate::db::HistoryEntry { + last_used_date: entry.last_used_date.clone(), + password: p, + }) }) .collect() } else { vec![] }; + let (folder, folder_id) = if let Some(folder_id) = &self.folder_id { let mut folder_name = None; for folder in folders { @@ -459,7 +463,7 @@ struct SyncResPasswordHistory { #[serde(rename = "LastUsedDate")] last_used_date: String, #[serde(rename = "Password")] - password: String, + password: Option<String>, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] |