diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index ed16a51a1..0d2aecc58 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -82,8 +82,7 @@ std::optional PackageInfo::queryDrvPath() const } else drvPath = {std::nullopt}; } - drvPath.value_or(std::nullopt); - return *drvPath; + return drvPath.value_or(std::nullopt); } diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc index 920490cfa..10fe7923f 100644 --- a/src/libexpr/print.cc +++ b/src/libexpr/print.cc @@ -278,7 +278,7 @@ private: storePath = state.coerceToStorePath(i->pos, *i->value, context, "while evaluating the drvPath of a derivation"); } - /* This unforutately breaks printing nested values because of + /* This unfortunately breaks printing nested values because of how the pretty printer is used (when pretting printing and warning to same terminal / std stream). */ #if 0