Skip to content

Commit e64bc16

Browse files
committed
fix panic on close before started
1 parent d446ace commit e64bc16

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

protocol/group/mutableurltest.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,13 @@ func (g *urlTestGroup) Close() error {
299299
if g.isClosed() {
300300
return nil
301301
}
302+
g.cancel()
303+
302304
g.access.Lock()
303305
defer g.access.Unlock()
304-
g.cancel()
305-
close(g.pauseC)
306+
if g.pauseC != nil {
307+
close(g.pauseC)
308+
}
306309
return nil
307310
}
308311

0 commit comments

Comments
 (0)