瀏覽代碼

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 年之前
父節點
當前提交
4f01cb855a
共有 1 個文件被更改,包括 1 次插入1 次删除
  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();
         }