Skip to content

Commit 296d2bc

Browse files
committed
Check that require.main.filename is defined (#233)
1 parent 7019cb3 commit 296d2bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function getFunction(line) {
110110
}
111111
}
112112

113-
var mainModule = (require.main && path.dirname(require.main.filename) || process.cwd()) + '/';
113+
var mainModule = (require.main && require.main.filename && path.dirname(require.main.filename) || process.cwd()) + '/';
114114

115115
function getModule(filename, base) {
116116
if (!base) base = mainModule;

0 commit comments

Comments
 (0)