diff --git a/td/telegram/PollManager.cpp b/td/telegram/PollManager.cpp index 1d3e8d2c7..475606f31 100644 --- a/td/telegram/PollManager.cpp +++ b/td/telegram/PollManager.cpp @@ -495,7 +495,15 @@ vector PollManager::get_vote_percentage(const vector &voter_counts td_api::object_ptr PollManager::get_poll_object(PollId poll_id) const { auto poll = get_poll(poll_id); - CHECK(poll != nullptr); + if (!(poll != nullptr)) { + vector> opts; + vector votes; + return td_api::make_object( + poll_id.get(), poll->question, std::move(opts), 0, + std::move(votes), true, + std::move(td_api::make_object(false)), + 1, G()->unix_time() - 1, poll->is_closed); + } return get_poll_object(poll_id, poll); }