mirror of
https://github.com/livekit/livekit.git
synced 2026-07-28 07:49:30 +00:00
rtc: guard against nil subscriber in TransportManager.HandleAnswer (#4680)
In single-PC and one-shot signalling modes the subscriber PCTransport is never created, so t.subscriber is nil. Every other TransportManager method that touches the subscriber nil-checks it first; HandleAnswer did not, so a client sending an SDP answer in those modes crashed the process with a nil pointer dereference. Guard it and log, matching AddICECandidate/Negotiate. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8c14a617f5
commit
5407ee03ae
@@ -560,6 +560,11 @@ func (t *TransportManager) ProcessPendingPublisherOffer() {
|
||||
}
|
||||
|
||||
func (t *TransportManager) HandleAnswer(answer webrtc.SessionDescription, answerId uint32) {
|
||||
if t.subscriber == nil {
|
||||
// no subscriber transport in single-PC / one-shot signalling mode
|
||||
t.params.Logger.Warnw("answer received, but no subscriber peer connection", nil)
|
||||
return
|
||||
}
|
||||
t.subscriber.HandleRemoteDescription(answer, answerId)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user