Jean Kruger
Committed by GitHub

Avoid a crash on reconnection when a track is disposed (#691)

---
"client-sdk-android": patch
---
Avoid a crash on reconnection when a track is disposed
... ...
... ... @@ -612,9 +612,15 @@ internal constructor(
if (engine.connectionState == ConnectionState.DISCONNECTED) {
onPublishFailure(TrackException.PublishException("Not connected!"))
return null
}
val cid = track.rtcTrack.id()
val cid = try {
track.rtcTrack.id()
} catch (e: Exception) {
onPublishFailure(TrackException.PublishException("Failed to get track id", e))
return null
}
// For fast publish, we can negotiate PC and request add track at the same time
suspend fun negotiate() {
... ...