diff --git a/lib/domain/libimagcontact/src/iter.rs b/lib/domain/libimagcontact/src/iter.rs index 1f99c873..48f0f403 100644 --- a/lib/domain/libimagcontact/src/iter.rs +++ b/lib/domain/libimagcontact/src/iter.rs @@ -43,8 +43,9 @@ impl<'a> Iterator for ContactIter<'a> { fn next(&mut self) -> Option { loop { match self.0.next() { - None => return None, - Some(sid) => match self.1.get(sid.clone()).map_err(From::from) { + None => return None, + Some(Err(e)) => return Some(Err(e).map_err(CE::from)), + Some(Ok(sid)) => match self.1.get(sid.clone()).map_err(From::from) { Err(e) => return Some(Err(e)), Ok(None) => return Some(Err(CE::from_kind(CEK::EntryNotFound(sid)))), Ok(Some(entry)) => match entry.is_contact().map_err(From::from) { diff --git a/lib/domain/libimagcontact/src/store.rs b/lib/domain/libimagcontact/src/store.rs index 88856b70..e2b9aea4 100644 --- a/lib/domain/libimagcontact/src/store.rs +++ b/lib/domain/libimagcontact/src/store.rs @@ -81,7 +81,10 @@ impl<'a> ContactStore<'a> for Store { let iter = self .entries()? .without_store() - .filter(|id| id.is_in_collection(&["contact"])); + .filter(|id| match *id { + Ok(ref id) => id.is_in_collection(&["contact"]), + Err(_) => true, + }); Ok(StoreIdIterator::new(Box::new(iter))) }