diff --git a/src/cache.cc b/src/cache.cc index 8e8cab5b..871d7e7f 100644 --- a/src/cache.cc +++ b/src/cache.cc @@ -33,7 +33,8 @@ std::unique_ptr LoadCachedIndex(Config* config, return nullptr; auto result = Deserialize(filename, *file_content, IndexFile::kCurrentVersion); - result->is_loaded_from_cache_ = true; + if (result) + result->is_loaded_from_cache_ = true; return result; }