Fix crash when applying unknown fields.

fork-5.53.8
Cody Henthorne 2021-06-02 17:53:33 -04:00
rodzic 08e86b8c82
commit 3c522c677b
1 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -52,8 +52,16 @@ public class ApplyUnknownFieldsToSelfMigrationJob extends MigrationJob {
return;
}
Recipient self = Recipient.self();
RecipientDatabase.RecipientSettings settings = DatabaseFactory.getRecipientDatabase(context).getRecipientSettingsForSync(self.getId());
Recipient self;
RecipientDatabase.RecipientSettings settings;
try {
self = Recipient.self();
settings = DatabaseFactory.getRecipientDatabase(context).getRecipientSettingsForSync(self.getId());
} catch (RecipientDatabase.MissingRecipientException e) {
Log.w(TAG, "Unable to find self");
return;
}
if (settings == null || settings.getSyncExtras().getStorageProto() == null) {
Log.d(TAG, "No unknowns to apply");