Skip to content

Commit da08b12

Browse files
authored
webrtc: fix crash when loading an invalid configuration (#4856)
1 parent 61382e4 commit da08b12

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/servers/webrtc/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ func (s *Server) Initialize() error {
275275
if s.LocalTCPAddress != "" {
276276
s.tcpMuxLn, err = net.Listen(restrictnetwork.Restrict("tcp", s.LocalTCPAddress))
277277
if err != nil {
278-
s.udpMuxLn.Close()
278+
if s.udpMuxLn != nil {
279+
s.udpMuxLn.Close()
280+
}
279281
s.httpServer.close()
280282
ctxCancel()
281283
return err

0 commit comments

Comments
 (0)