소스 검색

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