mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Fix error message and avoid recalculation
This commit is contained in:
parent
bc165e28ae
commit
c4ada76e86
1 changed files with 2 additions and 2 deletions
|
@ -203,8 +203,8 @@ std::optional<Hash> Input::getNarHash() const
|
|||
if (auto s = maybeGetStrAttr(attrs, "narHash")) {
|
||||
auto hash = s->empty() ? Hash(htSHA256) : Hash::parseSRI(*s);
|
||||
if (hash.type != htSHA256)
|
||||
throw UsageError("narHash must be specified with SRI notation");
|
||||
return newHashAllowEmpty(*s, htSHA256);
|
||||
throw UsageError("narHash must use SHA-256");
|
||||
return hash;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue