diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java index a493f0d1..762e95ce 100644 --- a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java +++ b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java @@ -473,6 +473,9 @@ public class SignalAccount implements Closeable { registered = storage.registered; number = storage.number; username = storage.username; + if ("".equals(username)) { + username = null; + } encryptedDeviceName = storage.encryptedDeviceName; deviceId = storage.deviceId; isMultiDevice = storage.isMultiDevice; @@ -549,6 +552,9 @@ public class SignalAccount implements Closeable { registered = Utils.getNotNullNode(rootNode, "registered").asBoolean(); if (rootNode.hasNonNull("usernameIdentifier")) { username = rootNode.get("usernameIdentifier").asText(); + if ("".equals(username)) { + username = null; + } } if (rootNode.hasNonNull("uuid")) { try { diff --git a/lib/src/main/java/org/asamk/signal/manager/syncStorage/AccountRecordProcessor.java b/lib/src/main/java/org/asamk/signal/manager/syncStorage/AccountRecordProcessor.java index 9250505c..0e1a02b7 100644 --- a/lib/src/main/java/org/asamk/signal/manager/syncStorage/AccountRecordProcessor.java +++ b/lib/src/main/java/org/asamk/signal/manager/syncStorage/AccountRecordProcessor.java @@ -104,7 +104,7 @@ public class AccountRecordProcessor extends DefaultStorageRecordProcessor