Fix: If the field is not available, return false

The function is for checking whether a flag is set. If the flag is not
available, the flag is obviously not set.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-02-17 10:27:20 +01:00
parent a6ad19a14f
commit 84c6a1981e
2 changed files with 2 additions and 2 deletions

View file

@ -81,7 +81,7 @@ impl Is for ::libimagstore::store::Entry {
match self.get_header().read_bool(field).map_err(Error::from)? {
Some(b) => Ok(b),
None => Err(format_err!("Field {} not available", field)),
None => Ok(false),
}
}

View file

@ -40,7 +40,7 @@
extern crate filters;
extern crate toml;
extern crate toml_query;
#[macro_use] extern crate failure;
extern crate failure;
extern crate libimagstore;
extern crate libimagerror;