diff --git a/td/mtproto/SessionConnection.cpp b/td/mtproto/SessionConnection.cpp index 2c4b48687..039660f7a 100644 --- a/td/mtproto/SessionConnection.cpp +++ b/td/mtproto/SessionConnection.cpp @@ -662,6 +662,7 @@ bool SessionConnection::must_flush_packet() { } Status SessionConnection::before_write() { + CHECK(raw_connection_); while (must_flush_packet()) { flush_packet(); } @@ -715,12 +716,14 @@ void SessionConnection::on_read(size_t size) { SessionConnection::SessionConnection(Mode mode, unique_ptr raw_connection, AuthData *auth_data) : raw_connection_(std::move(raw_connection)), auth_data_(auth_data) { + CHECK(raw_connection_); state_ = Init; mode_ = mode; created_at_ = Time::now(); } PollableFdInfo &SessionConnection::get_poll_info() { + CHECK(raw_connection_); return raw_connection_->get_poll_info(); }