mirror of
https://github.com/NixOS/nix.git
synced 2024-11-27 01:02:34 +00:00
Merge pull request #11933 from DeterminateSystems/no-narHash
fetchTree: Don't crash if narHash is missing
This commit is contained in:
commit
838d3c1ad0
@ -33,9 +33,8 @@ void emitTreeAttrs(
|
||||
|
||||
// FIXME: support arbitrary input attributes.
|
||||
|
||||
auto narHash = input.getNarHash();
|
||||
assert(narHash);
|
||||
attrs.alloc("narHash").mkString(narHash->to_string(HashFormat::SRI, true));
|
||||
if (auto narHash = input.getNarHash())
|
||||
attrs.alloc("narHash").mkString(narHash->to_string(HashFormat::SRI, true));
|
||||
|
||||
if (input.getType() == "git")
|
||||
attrs.alloc("submodules").mkBool(
|
||||
|
Loading…
Reference in New Issue
Block a user