Skip to content

Commit 2c1245b

Browse files
captain-refactorgrant
authored andcommitted
Adding null check in catch block (#71)
Catch null ex.stack
1 parent a399ad0 commit 2c1245b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/invoker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export function getUserFunction(
193193
} catch (ex) {
194194
let additionalHint: string;
195195
// TODO: this should be done based on ex.code rather than string matching.
196-
if (ex.stack.includes('Cannot find module')) {
196+
if (ex.stack && ex.stack.includes('Cannot find module')) {
197197
additionalHint =
198198
'Did you list all required modules in the package.json ' +
199199
'dependencies?\n';

0 commit comments

Comments
 (0)