Skip to content

Commit

Permalink
Fix index out of range error.
Browse files Browse the repository at this point in the history
  • Loading branch information
林志宇 committed Jun 1, 2019
1 parent 504c92a commit c3b94f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/dms/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ func (c *Transport) close() (closed bool) {

func (c *Transport) awaitResponse(ctx context.Context) error {
select {
case f := <-c.readCh:
case f, ok := <-c.readCh:
if !ok {
return io.ErrClosedPipe
}
if f.Type() == AcceptType {
return nil
}
Expand Down

0 comments on commit c3b94f4

Please sign in to comment.