Skip to content

Commit

Permalink
fix sserver crash when received a ExMessage before dispatcher_ inited.
Browse files Browse the repository at this point in the history
  • Loading branch information
SwimmingTiger committed Jan 15, 2019
1 parent f14107a commit ff0c16a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/StratumSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ bool StratumSession::handleMessage() {
string exMessage;
exMessage.resize(len);
evbuffer_remove(buffer_, &exMessage.front(), exMessage.size());
dispatcher_->handleExMessage(exMessage);
if (dispatcher_) {
dispatcher_->handleExMessage(exMessage);
}
return true; // read message success, return true
}

Expand Down

0 comments on commit ff0c16a

Please sign in to comment.