Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Check that require.main.filename is defined (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
LewisJEllis committed Nov 18, 2016
1 parent a332563 commit 7ecc524
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function getFunction(line) {
}
}

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

function getModule(filename, base) {
if (!base) base = mainModule;
Expand Down

0 comments on commit 7ecc524

Please sign in to comment.