Fix applying poll answer.

GitOrigin-RevId: 1100874484111cf65f05f7254a131ab70fc3eecc
This commit is contained in:
levlam 2019-03-16 23:48:00 +03:00
parent 3268cbdd8a
commit e17768bcc3

View File

@ -665,12 +665,14 @@ void PollManager::on_set_poll_answer(PollId poll_id, uint64 generation,
auto promises = std::move(pending_answer.promises_);
pending_answers_.erase(it);
td_->updates_manager_->on_get_updates(result.move_as_ok());
if (result.is_ok()) {
td_->updates_manager_->on_get_updates(result.move_as_ok());
for (auto &promise : promises) {
if (result.is_ok()) {
for (auto &promise : promises) {
promise.set_value(Unit());
} else {
}
} else {
for (auto &promise : promises) {
promise.set_error(result.error().clone());
}
}