diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index ad9e39e8..98fc79ff 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -3679,8 +3679,9 @@ td_api::object_ptr Td::static_request(td_api::object_ptr(400, "Request is empty"); } - bool need_logging = [&] { - switch (function->get_id()) { + auto function_id = function->get_id(); + bool need_logging = [function_id] { + switch (function_id) { case td_api::parseTextEntities::ID: case td_api::getFileMimeType::ID: case td_api::getFileExtension::ID: @@ -3700,6 +3701,7 @@ td_api::object_ptr Td::static_request(td_api::object_ptr response; downcast_call(*function, [&response](auto &request) { response = Td::do_static_request(request); }); + LOG_CHECK(response != nullptr) << function_id; if (need_logging) { VLOG(td_requests) << "Sending result for static request: " << to_string(response);