diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index fe2a359af..5a22922ac 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -12022,6 +12022,7 @@ void ContactsManager::on_get_user_full(tl_object_ptr &&u } ContactsManager::UserPhotos *ContactsManager::add_user_photos(UserId user_id) { + CHECK(user_id.is_valid()); auto &user_photos_ptr = user_photos_[user_id]; if (user_photos_ptr == nullptr) { user_photos_ptr = make_unique(); diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index f53401ff1..1de1f3a55 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -1837,6 +1837,7 @@ void UpdatesManager::try_reload_data() { } void UpdatesManager::subscribe_to_transcribed_audio_updates(int64 transcription_id, TranscribedAudioHandler on_update) { + CHECK(transcription_id != 0); if (pending_audio_transcriptions_.count(transcription_id) != 0) { on_pending_audio_transcription_failed(transcription_id, Status::Error(500, "Receive duplicate speech recognition identifier")); diff --git a/td/telegram/VideoNotesManager.cpp b/td/telegram/VideoNotesManager.cpp index b59c63d1c..928c4785f 100644 --- a/td/telegram/VideoNotesManager.cpp +++ b/td/telegram/VideoNotesManager.cpp @@ -177,6 +177,7 @@ void VideoNotesManager::register_video_note(FileId video_note_file_id, FullMessa return; } LOG(INFO) << "Register video note " << video_note_file_id << " from " << full_message_id << " from " << source; + CHECK(video_note_file_id.is_valid()); bool is_inserted = video_note_messages_[video_note_file_id].insert(full_message_id).second; LOG_CHECK(is_inserted) << source << ' ' << video_note_file_id << ' ' << full_message_id; is_inserted = message_video_notes_.emplace(full_message_id, video_note_file_id).second; @@ -190,6 +191,7 @@ void VideoNotesManager::unregister_video_note(FileId video_note_file_id, FullMes return; } LOG(INFO) << "Unregister video note " << video_note_file_id << " from " << full_message_id << " from " << source; + CHECK(video_note_file_id.is_valid()); auto &message_ids = video_note_messages_[video_note_file_id]; auto is_deleted = message_ids.erase(full_message_id) > 0; LOG_CHECK(is_deleted) << source << ' ' << video_note_file_id << ' ' << full_message_id; diff --git a/td/telegram/VoiceNotesManager.cpp b/td/telegram/VoiceNotesManager.cpp index b3d0b9c0f..f7520951f 100644 --- a/td/telegram/VoiceNotesManager.cpp +++ b/td/telegram/VoiceNotesManager.cpp @@ -141,6 +141,7 @@ void VoiceNotesManager::register_voice_note(FileId voice_note_file_id, FullMessa return; } LOG(INFO) << "Register voice note " << voice_note_file_id << " from " << full_message_id << " from " << source; + CHECK(voice_note_file_id.is_valid()); bool is_inserted = voice_note_messages_[voice_note_file_id].insert(full_message_id).second; LOG_CHECK(is_inserted) << source << ' ' << voice_note_file_id << ' ' << full_message_id; is_inserted = message_voice_notes_.emplace(full_message_id, voice_note_file_id).second; @@ -154,6 +155,7 @@ void VoiceNotesManager::unregister_voice_note(FileId voice_note_file_id, FullMes return; } LOG(INFO) << "Unregister voice note " << voice_note_file_id << " from " << full_message_id << " from " << source; + CHECK(voice_note_file_id.is_valid()); auto &message_ids = voice_note_messages_[voice_note_file_id]; auto is_deleted = message_ids.erase(full_message_id) > 0; LOG_CHECK(is_deleted) << source << ' ' << voice_note_file_id << ' ' << full_message_id;