Unverified Commit 2066f29c authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #583 from RocketChat/fix/force-migrate-crash

Fix forced schema update without migration crash
parents 9daf0a31 48580aae
...@@ -20,8 +20,8 @@ android { ...@@ -20,8 +20,8 @@ android {
applicationId "chat.rocket.android" applicationId "chat.rocket.android"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 52 versionCode 53
versionName "1.0.29" versionName "1.0.30"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
multiDexEnabled true multiDexEnabled true
......
...@@ -74,7 +74,14 @@ public class Migration implements RealmMigration { ...@@ -74,7 +74,14 @@ 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) {
if (BuildConfig.DEBUG) {
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