diff --git a/lix/libstore/binary-cache-store.cc b/lix/libstore/binary-cache-store.cc index d9487f5b0..dde94acd0 100644 --- a/lix/libstore/binary-cache-store.cc +++ b/lix/libstore/binary-cache-store.cc @@ -190,6 +190,7 @@ try { auto * buildIdDir = std::get_if(&narIndex); for (auto subdir : { "lib", "debug", ".build-id" }) { + if (!buildIdDir) break; // get returns nullptr subdir does not exist, and std::get_if propagates it. buildIdDir = std::get_if(get(buildIdDir->contents, subdir)); }