Fix panic for HomeKit source without SRTP module #712

This commit is contained in:
Alex X
2023-10-27 17:08:07 +03:00
parent c27e735c17
commit 2dd47654e6

View File

@@ -1,6 +1,7 @@
package homekit
import (
"errors"
"io"
"net"
"net/http"
@@ -134,6 +135,10 @@ var log zerolog.Logger
var servers map[string]*server
func streamHandler(url string) (core.Producer, error) {
if srtp.Server == nil {
return nil, errors.New("homekit: can't work without SRTP server")
}
return homekit.Dial(url, srtp.Server)
}