Skip to content

Commit

Permalink
Make sure sess.inflightReqs is not nil before accessing it.
Browse files Browse the repository at this point in the history
  • Loading branch information
aforge committed Oct 16, 2020
1 parent 3f5b019 commit 1344186
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ func (h *Hub) run() {
select {
case t.reg <- join:
default:
join.sess.inflightReqs.Done()
if join.sess.inflightReqs != nil {
join.sess.inflightReqs.Done()
}
join.sess.queueOut(ErrServiceUnavailableReply(join.pkt, join.pkt.Timestamp))
log.Println("hub.join loop: topic's reg queue full", join.pkt.RcptTo, join.sess.sid, " - total queue len:", len(t.reg))
}
Expand Down

0 comments on commit 1344186

Please sign in to comment.