From 117744381bad95e5f6c19f796da71fa87571d6a6 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Sun, 15 Nov 2026 18:44:18 +0000 Subject: [PATCH] module: add missing return in ImportMetaResolveLazyGetter When the creation context of the import.meta object has no associated Realm, the getter threw ERR_INVALID_INVOCATION but then fell through and dereferenced the null Realm. Return after throwing, as the other error paths in the getter already do. Assisted-by: Claude Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/67496 Reviewed-By: Vladimir Morozov Reviewed-By: Yagiz Nizipli --- src/module_wrap.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 96c83f37f57..8a122aeb65f 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -1261,6 +1261,7 @@ static void ImportMetaResolveLazyGetter( Realm* realm = Realm::GetCurrent(context); if (realm == nullptr) { THROW_ERR_INVALID_INVOCATION(isolate); + return; } Local initializer = realm->host_import_meta_resolve_initializer(); if (initializer.IsEmpty()) {