From f3a62bbfc28ecc1a4dff97f57be8718ce0d2c8fd Mon Sep 17 00:00:00 2001 From: Oscar Mira Date: Fri, 10 May 2024 16:47:44 +0200 Subject: [PATCH] Fix NPE when syncing archived flag from linked devices Fixes #306 --- .../api/messages/multidevice/DeviceContactsInputStream.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libsignal-service/src/main/java/org/whispersystems/signalservice/api/messages/multidevice/DeviceContactsInputStream.java b/libsignal-service/src/main/java/org/whispersystems/signalservice/api/messages/multidevice/DeviceContactsInputStream.java index 69fb58eb72..1921952c36 100644 --- a/libsignal-service/src/main/java/org/whispersystems/signalservice/api/messages/multidevice/DeviceContactsInputStream.java +++ b/libsignal-service/src/main/java/org/whispersystems/signalservice/api/messages/multidevice/DeviceContactsInputStream.java @@ -106,7 +106,9 @@ public DeviceContact read() throws IOException { inboxPosition = Optional.of(details.inboxPosition); } - archived = details.archived; + if (details.archived != null) { + archived = details.archived; + } return new DeviceContact(aci, e164, name, avatar, color, verified, profileKey, expireTimer, inboxPosition, archived); }