Browse Source

Fix crash when setting participant layout before receiving the data

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 <danxuliu@gmail.com>
Daniel Calviño Sánchez 2 years ago
parent
commit
4f01cb855a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

+ 1 - 1
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();
         }