Explorar o código

server_test: don't crash in serverTesters.Close if using optOnlyServer

Brad Fitzpatrick %!s(int64=11) %!d(string=hai) anos
pai
achega
e12a06aa74
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      server_test.go

+ 3 - 1
server_test.go

@@ -164,7 +164,9 @@ func (st *serverTester) streamState(id uint32) streamState {
 
 func (st *serverTester) Close() {
 	st.ts.Close()
-	st.cc.Close()
+	if st.cc != nil {
+		st.cc.Close()
+	}
 	log.SetOutput(os.Stderr)
 }