Fix NPE in account record proto parsing.
This commit is contained in:
parent
046ce30e08
commit
5285dd1665
1 changed files with 6 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue