Fix FolderCipher creation, handle some errors

This commit is contained in:
Miroslav Prasil
2018-05-01 16:54:22 +01:00
parent 514a372bc8
commit c3be1b4298
3 changed files with 12 additions and 8 deletions

View File

@ -163,10 +163,10 @@ impl Cipher {
current_folder.delete(&conn).or(Err("Failed removing old folder mapping"))
},
None => Ok(()) // Weird, but nothing to do
};
FolderCipher::new(&new_folder, &self.uuid)
.save(&conn).or(Err("Couldn't save folder setting"))
}.and_then(
|()| FolderCipher::new(&new_folder, &self.uuid)
.save(&conn).or(Err("Couldn't save folder setting"))
)
}
},
None => {