Skip to content

Commit 7bc701e

Browse files
committed
Emit warning logs for unhandled datastreams
1 parent d89d7b9 commit 7bc701e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

livekit-android-sdk/src/main/java/io/livekit/android/room/datastream/incoming/IncomingDataStreamManager.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,24 @@ class IncomingDataStreamManagerImpl @Inject constructor() : IncomingDataStreamMa
268268
return when (info) {
269269
is ByteStreamInfo -> {
270270
val handler = byteStreamHandlers[info.topic]
271-
272271
{ channel, identity ->
273-
handler?.invoke(ByteStreamReceiver(info, channel), identity)
272+
if (handler == null) {
273+
LKLog.i { "Received byte stream for topic \"${info.topic}\", but no handler was found. Ignoring." }
274+
} else {
275+
handler.invoke(ByteStreamReceiver(info, channel), identity)
276+
}
274277
}
275278
}
276279

277280
is TextStreamInfo -> {
278281
val handler = textStreamHandlers[info.topic]
279282

280283
{ channel, identity ->
281-
handler?.invoke(TextStreamReceiver(info, channel), identity)
284+
if (handler == null) {
285+
LKLog.w { "Received text stream for topic \"${info.topic}\", but no handler was found. Ignoring." }
286+
} else {
287+
handler.invoke(TextStreamReceiver(info, channel), identity)
288+
}
282289
}
283290
}
284291
}

0 commit comments

Comments
 (0)