Skip to content

Commit 999786d

Browse files
committed
Use the protected GlobalContext in the session bind handler
1 parent 682983c commit 999786d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/js_sync.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,14 @@ void SyncClass<T>::populate_sync_config(ContextType ctx, ObjectType realm_constr
267267

268268
EventLoopDispatcher<SyncBindSessionHandler> bind([=](const std::string& path, const realm::SyncConfig& config, std::shared_ptr<SyncSession>) {
269269
HANDLESCOPE
270-
ObjectType user_constructor = Object::validated_get_object(ctx, protected_sync, std::string("User"));
271-
FunctionType authenticate = Object::validated_get_function(ctx, user_constructor, std::string("_authenticateRealm"));
270+
ObjectType user_constructor = Object::validated_get_object(protected_ctx, protected_sync, std::string("User"));
271+
FunctionType authenticate = Object::validated_get_function(protected_ctx, user_constructor, std::string("_authenticateRealm"));
272272

273273
ValueType arguments[3];
274274
arguments[0] = Value::from_string(protected_ctx, path.c_str());
275275
arguments[1] = Value::from_string(protected_ctx, config.realm_url.c_str());
276276
arguments[2] = refresh;
277-
ObjectType user = create_object<T, UserClass<T>>(ctx, new SharedUser(config.user));
277+
ObjectType user = create_object<T, UserClass<T>>(protected_ctx, new SharedUser(config.user));
278278
Function::call(protected_ctx, authenticate, user, 3, arguments);
279279
});
280280

0 commit comments

Comments
 (0)