]> nmode's Git Repositories - signal-cli/commitdiff
Fix potential crash that could happen when legacy thread.id is null or empty
authorAsamK <asamk@gmx.de>
Fri, 27 Mar 2020 14:33:27 +0000 (15:33 +0100)
committerAsamK <asamk@gmx.de>
Fri, 27 Mar 2020 14:33:27 +0000 (15:33 +0100)
src/main/java/org/asamk/signal/storage/SignalAccount.java

index ebf7a8463e0283b1feafab484aab45797f3cb5a2..e806794f587accc22dc24131e31898bca1c8cb5a 100644 (file)
@@ -203,6 +203,9 @@ public class SignalAccount {
             LegacyJsonThreadStore threadStore = jsonProcessor.convertValue(threadStoreNode, LegacyJsonThreadStore.class);
             // Migrate thread info to group and contact store
             for (ThreadInfo thread : threadStore.getThreads()) {
+                if (thread.id == null || thread.id.isEmpty()) {
+                    continue;
+                }
                 try {
                     ContactInfo contactInfo = contactStore.getContact(new SignalServiceAddress(null, thread.id));
                     if (contactInfo != null) {