Add more checks that raw_connection_ isn't nullptr.

This commit is contained in:
levlam 2021-09-16 16:20:07 +03:00
parent 418db412c4
commit 9651243eaa
1 changed files with 3 additions and 0 deletions

View File

@ -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<RawConnection> 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();
}