Fix potential crash that could happen when legacy thread.id is null or empty

This commit is contained in:
AsamK 2020-03-27 15:33:27 +01:00
parent 286070c054
commit 416f43b225

View file

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