diff --git a/libimagstore/src/storeid.rs b/libimagstore/src/storeid.rs index 1faf0375..94eb0c4a 100644 --- a/libimagstore/src/storeid.rs +++ b/libimagstore/src/storeid.rs @@ -20,8 +20,15 @@ pub struct StoreId { impl StoreId { - pub fn new(base: Option, id: PathBuf) -> StoreId { - StoreId { base: base, id: id } + pub fn new(base: Option, id: PathBuf) -> Result { + if id.is_absolute() { + Err(SEK::StoreIdLocalPartAbsoluteError.into_error()) + } else { + Ok(StoreId { + base: base, + id: id + }) + } } pub fn storified(self, store: &Store) -> StoreId {