diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 4e6b88b51..8958739c1 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -2027,14 +2027,15 @@ void UpdatesManager::add_pending_qts_update(tl_object_ptr void UpdatesManager::process_updates(vector> &&updates, bool force_apply, Promise &&promise) { - tl_object_ptr update_pts_changed; - int32 update_count = 0; for (auto &update : updates) { if (update != nullptr) { update_count++; } } + if (update_count == 0) { + return promise.set_value(Unit()); + } MultiPromiseActorSafe mpas{"OnProcessUpdatesMultiPromiseActor"}; Promise lock; @@ -2070,6 +2071,8 @@ void UpdatesManager::process_updates(vector> } } */ + + tl_object_ptr update_pts_changed; for (auto &update : updates) { if (update != nullptr) { // process updateNewChannelMessage first