diff --git a/src/import_pipeline.cc b/src/import_pipeline.cc index 823cb696..fa189f64 100644 --- a/src/import_pipeline.cc +++ b/src/import_pipeline.cc @@ -285,7 +285,12 @@ std::vector PreloadFileContents( bool loaded_entry = false; std::vector file_contents; cache_manager->IterateLoadedCaches([&](IndexFile* index) { - file_contents.push_back(FileContents(index->path, index->file_contents)); + optional index_content = ReadContent(index->path); + if (!index_content) { + LOG_S(ERROR) << "Failed to load index content for " << index->path; + return; + } + file_contents.push_back(FileContents(index->path, *index_content)); loaded_entry = loaded_entry || index->path == entry.filename; }); if (!loaded_entry)