From 4f01cb855aa9bf15d40a10a8341ad4810a6a8916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 10 Oct 2022 01:48:58 +0200 Subject: [PATCH] Fix crash when setting participant layout before receiving the data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When setting the participant layout, if the HPB is not used, the user ID is got from the participant list data fetched when a new participant is found. However, as the participant layout is setup as soon as a new participant is found the data may have not been received yet, which ended in a crash (NullPointerException). Now the access to the participant object is guarded to prevent that. Signed-off-by: Daniel Calviño Sánchez --- .../main/java/com/nextcloud/talk/activities/CallActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 9085f6abe..0339b33cd 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -2361,7 +2361,7 @@ public class CallActivity extends CallBaseActivity { String userId = ""; if (hasMCU) { userId = webSocketClient.getUserIdForSession(session); - } else if (participantMap.get(session).getCalculatedActorType() == Participant.ActorType.USERS) { + } else if (participantMap.get(session) != null && participantMap.get(session).getCalculatedActorType() == Participant.ActorType.USERS) { userId = participantMap.get(session).getCalculatedActorId(); }