Skip to content

Commit

Permalink
Check if the connection exists before shutting down.
Browse files Browse the repository at this point in the history
This fixes #2620
  • Loading branch information
AWoloszyn committed Mar 15, 2019
1 parent 483dcec commit e8d6db1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gapir/client/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ func (s *session) onClose(f func()) {
}

func (s *session) close(ctx context.Context) {
s.conn.Shutdown(ctx)
if s.conn != nil {
s.conn.Shutdown(ctx)
}
for _, f := range s.closeCBs {
f()
}
Expand Down

0 comments on commit e8d6db1

Please sign in to comment.