mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-22 08:29:38 +00:00
Fix crash when trying to load cache that does not exist
This commit is contained in:
parent
a97bd9d1c4
commit
d1287f8fc8
@ -953,11 +953,12 @@ bool ImportCachedIndex(IndexerConfig* config,
|
|||||||
for (auto& dependency_path : cache->dependencies) {
|
for (auto& dependency_path : cache->dependencies) {
|
||||||
std::cerr << "- Got dependency " << dependency_path << std::endl;
|
std::cerr << "- Got dependency " << dependency_path << std::endl;
|
||||||
std::unique_ptr<IndexedFile> cache = LoadCachedIndex(config, dependency_path);
|
std::unique_ptr<IndexedFile> cache = LoadCachedIndex(config, dependency_path);
|
||||||
if (GetLastModificationTime(cache->path) == cache->last_modification_time)
|
if (cache && GetLastModificationTime(cache->path) == cache->last_modification_time)
|
||||||
file_consumer_shared->Mark(cache->path);
|
file_consumer_shared->Mark(cache->path);
|
||||||
else
|
else
|
||||||
needs_reparse = true;
|
needs_reparse = true;
|
||||||
queue_do_id_map->Enqueue(Index_DoIdMap(std::move(cache)));
|
if (cache)
|
||||||
|
queue_do_id_map->Enqueue(Index_DoIdMap(std::move(cache)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Import primary file.
|
// Import primary file.
|
||||||
|
Loading…
Reference in New Issue
Block a user