diff options
Diffstat (limited to 'perl/lib/Nix')
-rw-r--r-- | perl/lib/Nix/Store.xs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perl/lib/Nix/Store.xs b/perl/lib/Nix/Store.xs index 4e038866e..8546f6307 100644 --- a/perl/lib/Nix/Store.xs +++ b/perl/lib/Nix/Store.xs @@ -303,11 +303,14 @@ SV * derivationFromPath(char * drvPath) hash = newHV(); HV * outputs = newHV(); - for (auto & i : drv.outputsAndPaths(*store())) + for (auto & i : drv.outputsAndOptPaths(*store())) { hv_store( outputs, i.first.c_str(), i.first.size(), - newSVpv(store()->printStorePath(i.second.second).c_str(), 0), + !i.second.second + ? newSV(0) /* null value */ + : newSVpv(store()->printStorePath(*i.second.second).c_str(), 0), 0); + } hv_stores(hash, "outputs", newRV((SV *) outputs)); AV * inputDrvs = newAV(); |