Skip to content

Commit

Permalink
forceList: make pos mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
kamadorueda committed Jan 21, 2022
1 parent b977139 commit f1268a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nix/prefetch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ string resolveMirrorUrl(EvalState & state, string url)
auto mirrorList = vMirrors.attrs->find(state.symbols.create(mirrorName));
if (mirrorList == vMirrors.attrs->end())
throw Error("unknown mirror name '%s'", mirrorName);
state.forceList(*mirrorList->value);
state.forceList(*mirrorList->value, noPos);

if (mirrorList->value->listSize() < 1)
throw Error("mirror URL '%s' did not expand to anything", url);
Expand Down Expand Up @@ -200,7 +200,7 @@ static int main_nix_prefetch_url(int argc, char * * argv)

/* Extract the URL. */
auto & attr = v.attrs->need(state->symbols.create("urls"));
state->forceList(*attr.value);
state->forceList(*attr.value, noPos);
if (attr.value->listSize() < 1)
throw Error("'urls' list is empty");
url = state->forceString(*attr.value->listElems()[0]);
Expand Down

0 comments on commit f1268a7

Please sign in to comment.