Fix crash when adding a property to a model without updating the schema version.

This commit is contained in:
JP Simard 2015-08-03 10:11:43 -07:00 committed by Ari Lazier
parent 043f5ff4ab
commit 453e4d8277
1 changed files with 4 additions and 3 deletions

View File

@ -232,9 +232,10 @@ void ObjectStore::update_column_mapping(Group *group, ObjectSchema &target_schem
ObjectSchema table_schema(group, target_schema.name);
for (auto& target_prop : target_schema.properties) {
auto table_prop = table_schema.property_for_name(target_prop.name);
REALM_ASSERT_DEBUG(table_prop);
target_prop.table_column = table_prop->table_column;
if (table_prop) {
// Update target property column to match what's in the realm if it exists
target_prop.table_column = table_prop->table_column;
}
}
}