diff --git a/lix/libstore/binary-cache-store.cc b/lix/libstore/binary-cache-store.cc index 6e14cf4ad..c3eb0a4c5 100644 --- a/lix/libstore/binary-cache-store.cc +++ b/lix/libstore/binary-cache-store.cc @@ -221,6 +221,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)); }