Add error msg for producer empty medias

This commit is contained in:
Alexey Khit
2023-07-23 17:04:19 +03:00
parent d6172587b3
commit e94f338b77
+4
View File
@@ -210,6 +210,10 @@ func (s *Stream) MarshalJSON() ([]byte, error) {
func formatError(statMedias []*core.Media, statErrors []error) error {
var text string
if statMedias == nil {
return errors.New("can't get medias for stream")
}
for _, media := range statMedias {
if media.Direction == core.DirectionRecvonly {
continue