Skip to content

Commit

Permalink
vm: harden check for non-module in vm.modules linker
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Ralphson <[email protected]>
  • Loading branch information
MikeRalphson committed Apr 16, 2023
1 parent 070c9a8 commit 1586f93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/vm/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class SourceTextModule extends Module {

const promises = this[kWrap].link(async (identifier, assert) => {
const module = await linker(identifier, this, { assert });
if (module[kWrap] === undefined) {
if (module === undefined || module[kWrap] === undefined) {
throw new ERR_VM_MODULE_NOT_MODULE();
}
if (module.context !== this.context) {
Expand Down

0 comments on commit 1586f93

Please sign in to comment.