mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 17:11:59 +00:00
Fix LoadCachedIndex crash if deserialization failed.
This commit is contained in:
parent
7faedfdf00
commit
81594a1497
@ -33,7 +33,8 @@ std::unique_ptr<IndexFile> 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user