From fb57ef47bc4d7c4581a099ba1bfb3dd4b464a09b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 5 May 2020 09:37:24 +0200 Subject: [PATCH] catch IllegalStateException around acceptCall() this can happen when the UI races a call retrection --- .../java/eu/siacs/conversations/ui/RtpSessionActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index e7f4d9e92..6b1d64bcf 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -147,7 +147,11 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe private void checkRecorderAndAcceptCall() { checkMicrophoneAvailability(); - requireRtpConnection().acceptCall(); + try { + requireRtpConnection().acceptCall(); + } catch (final IllegalStateException e) { + Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show(); + } } private void checkMicrophoneAvailability() {