diff --git a/qmp/socket.go b/qmp/socket.go index 383b575..c929a77 100644 --- a/qmp/socket.go +++ b/qmp/socket.go @@ -104,7 +104,9 @@ func (mon *SocketMonitor) Disconnect() error { atomic.StoreInt32(mon.listeners, 0) err := mon.c.Close() - for range mon.stream { + if mon.stream != nil { + for range mon.stream { + } } return err @@ -266,7 +268,7 @@ func (mon *SocketMonitor) RunWithFile(command []byte, file *os.File) ([]byte, er type banner struct { QMP struct { Capabilities []string `json:"capabilities"` - Version Version `json:"version"` + Version Version `json:"version"` } `json:"QMP"` }