mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-01 14:13:22 +01:00
Fix NPE in account record proto parsing.
This commit is contained in:
@@ -49,10 +49,15 @@ public final class SignalAccountRecord implements SignalRecord {
|
||||
this.profileKey = OptionalUtil.absentIfEmpty(proto.profileKey);
|
||||
this.avatarUrlPath = OptionalUtil.absentIfEmpty(proto.avatarUrlPath);
|
||||
this.pinnedConversations = new ArrayList<>(proto.pinnedConversations.size());
|
||||
this.payments = new Payments(proto.payments.enabled, OptionalUtil.absentIfEmpty(proto.payments.entropy));
|
||||
this.defaultReactions = new ArrayList<>(proto.preferredReactionEmoji);
|
||||
this.subscriber = new Subscriber(proto.subscriberCurrencyCode, proto.subscriberId.toByteArray());
|
||||
|
||||
if (proto.payments != null) {
|
||||
this.payments = new Payments(proto.payments.enabled, OptionalUtil.absentIfEmpty(proto.payments.entropy));
|
||||
} else {
|
||||
this.payments = new Payments(false, Optional.empty());
|
||||
}
|
||||
|
||||
for (AccountRecord.PinnedConversation conversation : proto.pinnedConversations) {
|
||||
pinnedConversations.add(PinnedConversation.fromRemote(conversation));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user