Commit 8b106500 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Catch exception caused by prior forced schema updates without migration to avoid crash

parent c20777bc
...@@ -74,7 +74,12 @@ public class Migration implements RealmMigration { ...@@ -74,7 +74,12 @@ public class Migration implements RealmMigration {
if (oldVersion == 5) { if (oldVersion == 5) {
RealmObjectSchema userSchema = schema.get("RealmUser"); RealmObjectSchema userSchema = schema.get("RealmUser");
userSchema.addField(RealmUser.NAME, String.class); try {
userSchema.addField(RealmUser.NAME, String.class);
} catch (IllegalArgumentException e) {
e.printStackTrace();
// ignore; it makes here if the schema for this model was already update before without migration
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment