diff options
author | Alain Zscheile <zseri.devel@ytrizja.de> | 2022-05-04 07:44:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-04 07:44:32 +0200 |
commit | 1385b2007804c8a0370f2a6555045a00e34b07c7 (patch) | |
tree | 3f83e56e03bd60d6c07d0ee14e70949df04b9e0f /src/libstore/builtins | |
parent | 9489b4b7ef73ab20e8f49213d8711ca56b59107e (diff) |
Get rid of most `.at` calls (#6393)
Use one of `get` or `getOr` instead which will either return a null-pointer (with a nicer error message) or a default value when the key is missing.
Diffstat (limited to 'src/libstore/builtins')
-rw-r--r-- | src/libstore/builtins/fetchurl.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/builtins/fetchurl.cc b/src/libstore/builtins/fetchurl.cc index af3dfc409..7d7924d77 100644 --- a/src/libstore/builtins/fetchurl.cc +++ b/src/libstore/builtins/fetchurl.cc @@ -24,7 +24,7 @@ void builtinFetchurl(const BasicDerivation & drv, const std::string & netrcData) Path storePath = getAttr("out"); auto mainUrl = getAttr("url"); - bool unpack = get(drv.env, "unpack").value_or("") == "1"; + bool unpack = getOr(drv.env, "unpack", "") == "1"; /* Note: have to use a fresh fileTransfer here because we're in a forked process. */ |