]> nmode's Git Repositories - signal-cli/commitdiff
Check if profileKey is null for old accounts
authorAsamK <asamk@gmx.de>
Mon, 3 May 2021 16:43:28 +0000 (18:43 +0200)
committerAsamK <asamk@gmx.de>
Mon, 3 May 2021 16:43:45 +0000 (18:43 +0200)
lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java

index 6d920cf6ed1b86cb0edba7cc92b06ca73fbd295d..6671bc76e4a96943271af3601b3afc65bebb49c9 100644 (file)
@@ -577,7 +577,8 @@ public class SignalAccount implements Closeable {
                             storageKey == null ? null : Base64.getEncoder().encodeToString(storageKey.serialize()))
                     .put("preKeyIdOffset", preKeyIdOffset)
                     .put("nextSignedPreKeyId", nextSignedPreKeyId)
-                    .put("profileKey", Base64.getEncoder().encodeToString(profileKey.serialize()))
+                    .put("profileKey",
+                            profileKey == null ? null : Base64.getEncoder().encodeToString(profileKey.serialize()))
                     .put("registered", registered)
                     .putPOJO("groupStore", groupStoreStorage)
                     .putPOJO("stickerStore", stickerStoreStorage);