Fix NPE in group change message processing.
This commit is contained in:
parent
cc6c724ee8
commit
d7314ec2a4
2 changed files with 7 additions and 2 deletions
|
@ -6,6 +6,7 @@ import okio.ByteString
|
|||
import org.signal.core.util.orNull
|
||||
import org.signal.libsignal.protocol.message.DecryptionErrorMessage
|
||||
import org.signal.libsignal.zkgroup.groups.GroupMasterKey
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedGroupChange
|
||||
import org.thoughtcrime.securesms.attachments.Attachment
|
||||
import org.thoughtcrime.securesms.attachments.PointerAttachment
|
||||
import org.thoughtcrime.securesms.database.model.StoryType
|
||||
|
@ -32,6 +33,9 @@ import kotlin.time.Duration.Companion.seconds
|
|||
|
||||
object SignalServiceProtoUtil {
|
||||
|
||||
@JvmStatic
|
||||
val emptyGroupChange: DecryptedGroupChange by lazy { DecryptedGroupChange() }
|
||||
|
||||
/** Contains some user data that affects the conversation */
|
||||
val DataMessage.hasRenderableContent: Boolean
|
||||
get() {
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.signal.storageservice.protos.groups.local.DecryptedGroup;
|
|||
import org.signal.storageservice.protos.groups.local.DecryptedGroupChange;
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedMember;
|
||||
import org.thoughtcrime.securesms.database.model.databaseprotos.DecryptedGroupV2Context;
|
||||
import org.thoughtcrime.securesms.messages.SignalServiceProtoUtil;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.Base64;
|
||||
|
@ -161,12 +162,12 @@ public final class MessageGroupContext {
|
|||
}
|
||||
|
||||
public @NonNull DecryptedGroupChange getChange() {
|
||||
return decryptedGroupV2Context.change;
|
||||
return decryptedGroupV2Context.change != null ? decryptedGroupV2Context.change : SignalServiceProtoUtil.getEmptyGroupChange();
|
||||
}
|
||||
|
||||
public @NonNull List<? extends ServiceId> getAllActivePendingAndRemovedMembers() {
|
||||
DecryptedGroup groupState = decryptedGroupV2Context.groupState;
|
||||
DecryptedGroupChange groupChange = decryptedGroupV2Context.change;
|
||||
DecryptedGroupChange groupChange = getChange();
|
||||
|
||||
return Stream.of(DecryptedGroupUtil.toAciList(groupState.members),
|
||||
DecryptedGroupUtil.pendingToServiceIdList(groupState.pendingMembers),
|
||||
|
|
Loading…
Add table
Reference in a new issue