aboutsummaryrefslogtreecommitdiff
path: root/src/nix/bundle.cc
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-03-04 19:47:32 +0100
committerpennae <github@quasiparticle.net>2022-04-21 21:25:18 +0200
commit38de79fcf7e00187107e638036c010911d1b675b (patch)
tree7d8c5f98e67b15b5d0de7ffc33641765d291acfd /src/nix/bundle.cc
parentff0fd91ed23ae9d851bf27c4df3ec77f7028699b (diff)
remove Bindings::need
a future commit will remove the ability to convert the symbol type used in bindings to strings. since we only have two users we can inline the error check.
Diffstat (limited to 'src/nix/bundle.cc')
-rw-r--r--src/nix/bundle.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nix/bundle.cc b/src/nix/bundle.cc
index 81fb8464a..ee91e8ed0 100644
--- a/src/nix/bundle.cc
+++ b/src/nix/bundle.cc
@@ -110,8 +110,10 @@ struct CmdBundle : InstallableCommand
auto outPathS = store->printStorePath(outPath);
if (!outLink) {
- auto &attr = vRes->attrs->need(evalState->sName);
- outLink = evalState->forceStringNoCtx(*attr.value,*attr.pos);
+ auto * attr = vRes->attrs->get(evalState->sName);
+ if (!attr)
+ throw Error("attribute 'name' missing");
+ outLink = evalState->forceStringNoCtx(*attr->value, *attr->pos);
}
// TODO: will crash if not a localFSStore?