1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

fromStructuredAttrs(): Don't crash if exportReferencesGraph is a string

Fixes

  error: [json.exception.type_error.302] type must be array, but is string

and other crashes.

Fixes #13254.
This commit is contained in:
Eelco Dolstra 2025-05-24 00:14:32 +02:00
parent fa6e10ea6a
commit d877b0c0cc
2 changed files with 9 additions and 2 deletions

View file

@ -225,6 +225,8 @@ void Store::queryMissing(const std::vector<DerivedPath> & targets,
auto parsedDrv = StructuredAttrs::tryParse(drv->env);
DerivationOptions drvOptions;
try {
// FIXME: this is a lot of work just to get the value
// of `allowSubstitutes`.
drvOptions = DerivationOptions::fromStructuredAttrs(
drv->env,
parsedDrv ? &*parsedDrv : nullptr);