Skip to content

Commit

Permalink
Merge pull request #11933 from DeterminateSystems/no-narHash
Browse files Browse the repository at this point in the history
fetchTree: Don't crash if narHash is missing
  • Loading branch information
Mic92 authored Nov 22, 2024
2 parents 09e989f + f4f4b69 commit 838d3c1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libexpr/primops/fetchTree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 838d3c1

Please sign in to comment.