Get document checks
This commit is contained in:
parent
2a5904b03e
commit
6a01d1ae80
|
@ -488,11 +488,13 @@ void DocumentsManager::create_document(FileId file_id, string minithumbnail, Pho
|
|||
|
||||
const DocumentsManager::GeneralDocument *DocumentsManager::get_document(FileId file_id) const {
|
||||
auto document = documents_.find(file_id);
|
||||
if (document == documents_.end()) {
|
||||
|
||||
if (document == documents_.end() ||
|
||||
document->second == nullptr ||
|
||||
document->second->file_id == file_id) {
|
||||
return make_unique<GeneralDocument>().get();
|
||||
}
|
||||
|
||||
CHECK(document->second->file_id == file_id);
|
||||
return document->second.get();
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue
Block a user