From 6143baed0bd155551a7298e1fa9bc33d505376b8 Mon Sep 17 00:00:00 2001 From: Saxon Date: Tue, 26 Feb 2019 09:06:25 +1030 Subject: [PATCH] rtmp: doing conn.close log message after we actually check that there is still a connection, otherwise we might have a nil logger and cause a panic --- rtmp/conn.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)