Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Commit

Permalink
Fix the check for if the ResultSets schema needs to be initialized
Browse files Browse the repository at this point in the history
Table::size() is not the number of columns in the table.
  • Loading branch information
tgoyne committed Aug 19, 2019
1 parent bcc6a75 commit 368205c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sync/partial_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ void ensure_partial_sync_schema_initialized(Realm& realm)
auto& group = realm.read_group();
// Check if the result sets table already has the expected number of columns
auto table = ObjectStore::table_for_object_type(group, result_sets_type_name);
if (table && table->size() >= result_sets_property_count)
if (table && table->get_column_count() >= result_sets_property_count)
return;

realm.begin_transaction();
// Recheck after starting the transaction as it refreshes
if (!table)
table = ObjectStore::table_for_object_type(group, result_sets_type_name);
if (table && table->size() >= result_sets_property_count)
if (table && table->get_column_count() >= result_sets_property_count)
return;
initialize_schema(group);
realm.commit_transaction();
Expand Down

0 comments on commit 368205c

Please sign in to comment.