disallow empty attributes in entries

feat/vaults
Tomáš Mládek 2022-02-19 17:30:55 +01:00
parent ea89e11738
commit 4e54c19ee5
No known key found for this signature in database
GPG Key ID: 65E225C8B3E2ED8A
1 changed files with 3 additions and 0 deletions

View File

@ -60,6 +60,9 @@ impl TryFrom<&Entry> for models::Entry {
type Error = anyhow::Error;
fn try_from(e: &Entry) -> Result<Self, Self::Error> {
if e.attribute.is_empty() {
return Err(anyhow!("Attribute cannot be empty."));
}
let base_entry = models::Entry {
identity: e.address()?.encode()?,
entity_searchable: match &e.entity {