diff --git a/rtmp/conn.go b/rtmp/conn.go index 7e1b3b15..4249a637 100644 --- a/rtmp/conn.go +++ b/rtmp/conn.go @@ -134,10 +134,10 @@ func Dial(url string, timeout uint, log Log) (*Conn, error) { // Close terminates the RTMP connection. // NB: Close is idempotent and the connection value is cleared completely. func (c *Conn) Close() error { - c.log(DebugLevel, pkg+"Conn.Close") if !c.isConnected() { return errNotConnected } + c.log(DebugLevel, pkg+"Conn.Close") if c.streamID > 0 { if c.link.protocol&featureWrite != 0 { sendFCUnpublish(c)