diff --git a/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt b/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt index da3a9559a4..7b8d8c9547 100644 --- a/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt +++ b/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt @@ -358,12 +358,14 @@ class VoiceBroadcastPlayerImpl @Inject constructor( playbackTicker = null val totalDuration = playlist.duration - val playbackTime = playbackTracker.getPlaybackTime(id) - val remainingTime = totalDuration - playbackTime - if (remainingTime < 1000) { - playbackTracker.updatePausedAtPlaybackTime(id, 0, 0f) - } else { - playbackTracker.pausePlayback(id) + if (totalDuration > 0) { + val playbackTime = playbackTracker.getPlaybackTime(id) + val remainingTime = totalDuration - playbackTime + if (remainingTime < 1000) { + playbackTracker.updatePausedAtPlaybackTime(id, 0, 0f) + } else { + playbackTracker.pausePlayback(id) + } } } }