mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
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 <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
1 parent
99e188b3db
commit
117744381b
1 file changed
+1
@@ -1261,6 +1261,7 @@ static void ImportMetaResolveLazyGetter(
|
||||
Realm* realm = Realm::GetCurrent(context);
|
||||
if (realm == nullptr) {
|
||||
THROW_ERR_INVALID_INVOCATION(isolate);
|
||||
return;
|
||||
}
|
||||
Local<Function> initializer = realm->host_import_meta_resolve_initializer();
|
||||
if (initializer.IsEmpty()) {
|
||||
|
||||
Reference in new issue
Block a user