Merge pull request #2387 from nextcloud/fix-crash-after-hangup-due-to-modifying-a-list-while-iterating-over-it

Fix crash after hangup due to modifying a list while iterating over it
This commit is contained in:
Andy Scherzinger 2022-09-19 09:33:44 +02:00 committed by GitHub
commit 679b601844
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1707,8 +1707,12 @@ public class CallActivity extends CallBaseActivity {
} }
} }
List<String> sessionIdsToEnd = new ArrayList<String>(peerConnectionWrapperList.size());
for (PeerConnectionWrapper wrapper : peerConnectionWrapperList) { for (PeerConnectionWrapper wrapper : peerConnectionWrapperList) {
endPeerConnection(wrapper.getSessionId(), false); sessionIdsToEnd.add(wrapper.getSessionId());
}
for (String sessionId : sessionIdsToEnd) {
endPeerConnection(sessionId, false);
} }
if (localStream != null) { if (localStream != null) {