Committed by
GitHub
Avoid a crash on reconnection when a track is disposed (#691)
正在显示
2 个修改的文件
包含
12 行增加
和
1 行删除
.changeset/young-scissors-sleep.md
0 → 100644
| @@ -612,9 +612,15 @@ internal constructor( | @@ -612,9 +612,15 @@ internal constructor( | ||
| 612 | 612 | ||
| 613 | if (engine.connectionState == ConnectionState.DISCONNECTED) { | 613 | if (engine.connectionState == ConnectionState.DISCONNECTED) { |
| 614 | onPublishFailure(TrackException.PublishException("Not connected!")) | 614 | onPublishFailure(TrackException.PublishException("Not connected!")) |
| 615 | + return null | ||
| 615 | } | 616 | } |
| 616 | 617 | ||
| 617 | - val cid = track.rtcTrack.id() | 618 | + val cid = try { |
| 619 | + track.rtcTrack.id() | ||
| 620 | + } catch (e: Exception) { | ||
| 621 | + onPublishFailure(TrackException.PublishException("Failed to get track id", e)) | ||
| 622 | + return null | ||
| 623 | + } | ||
| 618 | 624 | ||
| 619 | // For fast publish, we can negotiate PC and request add track at the same time | 625 | // For fast publish, we can negotiate PC and request add track at the same time |
| 620 | suspend fun negotiate() { | 626 | suspend fun negotiate() { |
-
请 注册 或 登录 后发表评论