fix: prevent crash in audio view

This commit is contained in:
jubb
2021-07-01 13:43:48 +10:00
parent c153ea2acf
commit 8701f68292
3 changed files with 5 additions and 3 deletions

View File

@@ -45,7 +45,9 @@ class VoiceMessageView : LinearLayout, AudioSlidePlayer.Listener {
val player = AudioSlidePlayer.createFor(context, audio, this)
this.player = player
isPreparing = true
player.play(0.0)
if (!audio.isPendingDownload && !audio.isInProgress) {
player.play(0.0)
}
voiceMessageViewLoader.isVisible = audio.isPendingDownload
val cornerRadii = MessageBubbleUtilities.calculateRadii(context, isStartOfMessageCluster, isEndOfMessageCluster, message.isOutgoing)
cornerMask.setTopLeftRadius(cornerRadii[0])