LocalStore::addToStore: Throw an exception if no hash is given
This commit is contained in:
parent
3cab639e21
commit
23d6bb583a
1 changed files with 2 additions and 1 deletions
|
@ -976,7 +976,8 @@ const PublicKeys & LocalStore::getPublicKeys()
|
||||||
void LocalStore::addToStore(const ValidPathInfo & info, Source & source,
|
void LocalStore::addToStore(const ValidPathInfo & info, Source & source,
|
||||||
RepairFlag repair, CheckSigsFlag checkSigs, std::shared_ptr<FSAccessor> accessor)
|
RepairFlag repair, CheckSigsFlag checkSigs, std::shared_ptr<FSAccessor> accessor)
|
||||||
{
|
{
|
||||||
assert(info.narHash);
|
if (!info.narHash)
|
||||||
|
throw Error("cannot add path '%s' because it lacks a hash", info.path);
|
||||||
|
|
||||||
if (requireSigs && checkSigs && !info.checkSignatures(*this, getPublicKeys()))
|
if (requireSigs && checkSigs && !info.checkSignatures(*this, getPublicKeys()))
|
||||||
throw Error("cannot add path '%s' because it lacks a valid signature", info.path);
|
throw Error("cannot add path '%s' because it lacks a valid signature", info.path);
|
||||||
|
|
Loading…
Reference in a new issue