Skip to content

Commit 7da0f91

Browse files
Fixed impossible empty streams check in Room.onAddTrack that could crash if WebRTC called onAddTrack with an empty streams array. (#816)
1 parent 2828664 commit 7da0f91

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"client-sdk-android": patch
3+
---
4+
5+
Fixed impossible empty streams check in Room.onAddTrack that could crash if WebRTC called onAddTrack with an empty streams array.

livekit-android-sdk/src/main/java/io/livekit/android/room/Room.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ constructor(
11561156
* @suppress
11571157
*/
11581158
override fun onAddTrack(receiver: RtpReceiver, track: MediaStreamTrack, streams: Array<out MediaStream>) {
1159-
if (streams.count() < 0) {
1159+
if (streams.isEmpty()) {
11601160
LKLog.i { "add track with empty streams?" }
11611161
return
11621162
}

0 commit comments

Comments
 (0)