diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 13cd3c0e0..549bddf1d 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -4366,14 +4366,15 @@ Result> ContactsManager::get_input_user(U } const User *u = get_user(user_id); - if (u == nullptr) { - return Status::Error(400, "User not found"); - } - if (u->access_hash == -1 || u->is_min_access_hash) { + if (u == nullptr || u->access_hash == -1 || u->is_min_access_hash) { if (td_->auth_manager_->is_bot() && user_id.is_valid()) { return make_tl_object(user_id.get(), 0); } - return Status::Error(400, "Have no access to the user"); + if (u == nullptr) { + return Status::Error(400, "User not found"); + } else { + return Status::Error(400, "Have no access to the user"); + } } return make_tl_object(user_id.get(), u->access_hash);