From 029633d215dc575e823adb8e3a72cd145b725e33 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 13 Oct 2020 18:40:12 +0200 Subject: [PATCH] Don't fail tests if the telnet module is not loaded --- stream/telnet/telnet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stream/telnet/telnet.go b/stream/telnet/telnet.go index 83ecc7d..d14024f 100644 --- a/stream/telnet/telnet.go +++ b/stream/telnet/telnet.go @@ -122,7 +122,7 @@ func Serve(config *Options) { // GetNumberConnectedSessions returns the numbers of clients that are viewing the stream through a telnet shell func GetNumberConnectedSessions(streamID string) int { - if !Cfg.Enabled { + if Cfg == nil || !Cfg.Enabled { return 0 } return clientCount[streamID]