Don't fail tests if the telnet module is not loaded

This commit is contained in:
Yohann D'ANELLO 2020-10-13 18:40:12 +02:00
parent 084ea676be
commit 029633d215
1 changed files with 1 additions and 1 deletions

View File

@ -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]