]> nmode's Git Repositories - signal-cli/commitdiff
Prevent endless loop when receiving contact sync message
authorAsamK <asamk@gmx.de>
Mon, 30 Aug 2021 11:55:25 +0000 (13:55 +0200)
committerAsamK <asamk@gmx.de>
Mon, 30 Aug 2021 11:55:25 +0000 (13:55 +0200)
lib/src/main/java/org/asamk/signal/manager/helper/SyncHelper.java

index 461706f012ee2fcfe5e5e2b9b482e70e4d39b0db..3cc76b28b760fe6c19f8e7d05f228a81bf6ce5d4 100644 (file)
@@ -222,8 +222,13 @@ public class SyncHelper {
             try {
                 c = s.read();
             } catch (IOException e) {
-                logger.warn("Sync contacts contained invalid contact, ignoring: {}", e.getMessage());
-                continue;
+                if (e.getMessage() != null && e.getMessage().contains("Missing contact address!")) {
+                    logger.warn("Sync contacts contained invalid contact, ignoring: {}", e.getMessage());
+                    continue;
+                } else {
+                    logger.warn("Failed to read sync contacts", e);
+                    break;
+                }
             }
             if (c == null) {
                 break;