add try-catch to util.resolveRelative
This commit is contained in:
parent
83eea2acc7
commit
e10bdf7c5b
@ -47,7 +47,11 @@ export function resolveRelative(loc: string) {
|
|||||||
relativeMod.paths = Module._nodeModulePaths(process.cwd());
|
relativeMod.paths = Module._nodeModulePaths(process.cwd());
|
||||||
}
|
}
|
||||||
|
|
||||||
return Module._resolveFilename(loc, relativeMod);
|
try {
|
||||||
|
return Module._resolveFilename(loc, relativeMod);
|
||||||
|
} catch (err) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function list(val: string): Array<string> {
|
export function list(val: string): Array<string> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user