Skip to content

Commit

Permalink
fix: Fixes panic if no connection (shurcooL#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
soluchok authored Sep 29, 2022
1 parent d2a5549 commit 835e565
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ func (sc *SubscriptionClient) Run() error {
case <-sc.context.Done():
return
default:
if sc.conn == nil {
return
}

var message OperationMessage
if err := sc.conn.ReadJSON(&message); err != nil {
// manual EOF check
Expand Down

0 comments on commit 835e565

Please sign in to comment.