Skip to content

Commit bccbb28

Browse files
authored
fix: harden check for non-module in vm.modules linker
1 parent 070c9a8 commit bccbb28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/vm/module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class SourceTextModule extends Module {
303303

304304
const promises = this[kWrap].link(async (identifier, assert) => {
305305
const module = await linker(identifier, this, { assert });
306-
if (module[kWrap] === undefined) {
306+
if (module === undefined || module[kWrap] === undefined) {
307307
throw new ERR_VM_MODULE_NOT_MODULE();
308308
}
309309
if (module.context !== this.context) {

0 commit comments

Comments
 (0)