diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index 3e364598e..69c306df3 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -3894,7 +3894,7 @@ void FileManager::memory_cleanup() { destroy_query(it->first); /* DESTROY MAIN NODE */ - file_nodes_.erase(it->first); + file_nodes_.erase(it->second.node_id_); /* DESTROY MAIN FILE LATE */ file_to_be_deleted.push_back(it->first);