Skip to content

Commit

Permalink
Fix crash when adding a property to a model without updating the sche…
Browse files Browse the repository at this point in the history
…ma version.
  • Loading branch information
jpsim authored and alazier committed Aug 13, 2015
1 parent 043f5ff commit 453e4d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions object_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 453e4d8

Please sign in to comment.