Fix crash when receiving GSE before state membership updated.

This commit is contained in:
Cody Henthorne
2024-07-31 16:32:46 -04:00
parent 79c7c2345f
commit e4966da3ef
2 changed files with 6 additions and 1 deletions

View File

@@ -325,7 +325,7 @@ class GroupsV2StateProcessor private constructor(
if (updatedGroupState == null || updatedGroupState == remoteGroupStateDiff.previousGroupState) {
Log.i(TAG, "$logPrefix Local state is at or later than server revision: ${currentLocalState?.revision ?: "null"}")
if (currentLocalState != null) {
if (currentLocalState != null && applyGroupStateDiffResult.remainingRemoteGroupChanges.isEmpty()) {
val endorsements = groupOperations.receiveGroupSendEndorsements(serviceIds.aci, currentLocalState, remoteGroupStateDiff.groupSendEndorsementsResponse)
if (endorsements != null) {

View File

@@ -1057,6 +1057,11 @@ public final class GroupsV2Operations {
List<ACI> members = decryptedGroup.members.stream().map(m -> ACI.parseOrThrow(m.aciBytes)).collect(Collectors.toList());
if (!members.contains(selfAci)) {
Log.w(TAG, "Attempting to receive endorsements for group state we aren't in, aborting");
return null;
}
GroupSendEndorsementsResponse.ReceivedEndorsements endorsements = null;
try {
endorsements = groupSendEndorsementsResponse.receive(