修复publisher为空的问题

This commit is contained in:
pggiroro
2024-04-10 21:05:23 +08:00
parent 35ff76f224
commit a3198be64a

View File

@@ -357,7 +357,7 @@ func (r *Stream) action(action StreamAction) (ok bool) {
stateEvent = SEclose{event}
r.Subscribers.Broadcast(stateEvent)
r.Tracks.Range(func(_ string, t common.Track) {
if t.GetPublisher().GetStream() == r {
if t.GetPublisher() == nil || t.GetPublisher().GetStream() == r {
t.Dispose()
}
})