mirror of
https://github.com/oxen-io/session-android.git
synced 2026-01-04 17:43:49 +00:00
Don't run UuidMigration if not registered.
This commit is contained in:
committed by
Alan Evans
parent
b9da012cc4
commit
2924a09936
@@ -1,6 +1,7 @@
|
|||||||
package org.thoughtcrime.securesms.migrations;
|
package org.thoughtcrime.securesms.migrations;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
@@ -52,8 +53,9 @@ public class UuidMigrationJob extends MigrationJob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void performMigration() throws Exception {
|
void performMigration() throws Exception {
|
||||||
if (!TextSecurePreferences.isPushRegistered(context)) {
|
if (!TextSecurePreferences.isPushRegistered(context) || TextUtils.isEmpty(TextSecurePreferences.getLocalNumber(context))) {
|
||||||
Log.w(TAG, "Not registered! Skipping migration, as it wouldn't do anything.");
|
Log.w(TAG, "Not registered! Skipping migration, as it wouldn't do anything.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchOwnUuid(context);
|
fetchOwnUuid(context);
|
||||||
|
|||||||
@@ -85,8 +85,10 @@ public final class LiveRecipientCache {
|
|||||||
|
|
||||||
if (localUuid != null) {
|
if (localUuid != null) {
|
||||||
localRecipientId = recipientDatabase.getByUuid(localUuid).or(recipientDatabase.getByE164(localE164)).orNull();
|
localRecipientId = recipientDatabase.getByUuid(localUuid).or(recipientDatabase.getByE164(localE164)).orNull();
|
||||||
} else {
|
} else if (localE164 != null) {
|
||||||
localRecipientId = recipientDatabase.getByE164(localE164).orNull();
|
localRecipientId = recipientDatabase.getByE164(localE164).orNull();
|
||||||
|
} else {
|
||||||
|
throw new AssertionError("Tried to call getSelf() before local data was set!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localRecipientId == null) {
|
if (localRecipientId == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user