diff --git a/lix/libstore/binary-cache-store.cc b/lix/libstore/binary-cache-store.cc index 51c5a26b2..820b583cc 100644 --- a/lix/libstore/binary-cache-store.cc +++ b/lix/libstore/binary-cache-store.cc @@ -225,6 +225,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)); }