Handle migration case where recipient_ids is completely empty

No idea how a DB is in that state, but apparently it's possible

Fixes #6850
// FREEBIE
pull/1/head
Moxie Marlinspike 8 years ago
parent 9a78615991
commit cb4303ac23

@ -922,10 +922,10 @@ public class DatabaseFactory {
if (resolved != null && resolved.moveToFirst()) {
String address = resolved.getString(0);
addresses[i] = DelimiterUtil.escape(numberMigrator.migrate(address), ' ');
} else if (recipientIds[i].equals("-1")) {
} else if (TextUtils.isEmpty(recipientIds[i]) || recipientIds[i].equals("-1")) {
addresses[i] = "Unknown";
} else {
throw new AssertionError("Unable to resolve: " + recipientIds[i]);
throw new AssertionError("Unable to resolve: " + recipientIds[i] + ", recipientIdsList: '" + recipientIdsList + "'");
}
if (resolved != null) resolved.close();
@ -995,10 +995,10 @@ public class DatabaseFactory {
if (resolved != null && resolved.moveToFirst()) {
String address = resolved.getString(0);
addresses[i] = DelimiterUtil.escape(numberMigrator.migrate(address), ' ');
} else if (recipientIds[i].equals("-1")) {
} else if (TextUtils.isEmpty(recipientIds[i]) || recipientIds[i].equals("-1")) {
addresses[i] = "Unknown";
} else {
throw new AssertionError("Unable to resolve: " + recipientIds[i]);
throw new AssertionError("Unable to resolve: " + recipientIds[i] + ", recipientIdsList: '" + recipientIdsList + "'");
}
if (resolved != null) resolved.close();

Loading…
Cancel
Save