1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-28 05:00:58 +01: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 09d46ad93a
commit af7bfe7827
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);