From ca1d8b4d1b3f4e77f56fe450f3759d40e9f9091a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 17 Feb 2024 09:05:40 +0100 Subject: [PATCH] fix race condition accessing rtpSender --- .../eu/siacs/conversations/xmpp/jingle/TrackWrapper.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/TrackWrapper.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/TrackWrapper.java index e62aa18fd..16e89ca3b 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/TrackWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/TrackWrapper.java @@ -65,8 +65,14 @@ class TrackWrapper { public static RtpTransceiver getTransceiver( @Nonnull final PeerConnection peerConnection, final TrackWrapper trackWrapper) { final RtpSender rtpSender = trackWrapper.rtpSender; + final String rtpSenderId; + try { + rtpSenderId = rtpSender.id(); + } catch (final IllegalStateException e) { + return null; + } for (final RtpTransceiver transceiver : peerConnection.getTransceivers()) { - if (transceiver.getSender().id().equals(rtpSender.id())) { + if (transceiver.getSender().id().equals(rtpSenderId)) { return transceiver; } }