diff --git a/src/RJSResults.cpp b/src/RJSResults.cpp index b0d1d709..2f990d14 100644 --- a/src/RJSResults.cpp +++ b/src/RJSResults.cpp @@ -102,7 +102,7 @@ JSObjectRef RJSResultsCreate(JSContextRef ctx, SharedRealm realm, std::string cl if (object_schema == realm->config().schema->end()) { throw std::runtime_error("Object type '" + className + "' not present in Realm."); } - return RJSWrapObject(ctx, RJSResultsClass(), new Results(realm, *object_schema, table->where())); + return RJSWrapObject(ctx, RJSResultsClass(), new Results(realm, *object_schema, *table)); }