Skip to content

Commit de5e2c6

Browse files
committed
require a file name before checking for a fallback
1 parent b31cc70 commit de5e2c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/coffee-script/command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
throw err;
9797
}
9898
if ((err != null ? err.code : void 0) === 'ENOENT') {
99-
if (topLevel && (_ref1 = path.extname(source), __indexOf.call(coffee_exts, _ref1) < 0)) {
99+
if (topLevel && source && (_ref1 = path.extname(source), __indexOf.call(coffee_exts, _ref1) < 0)) {
100100
source = sources[sources.indexOf(source)] = "" + source + ".coffee";
101101
return compilePath(source, topLevel, base);
102102
}

src/command.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ compilePath = (source, topLevel, base) ->
8686
fs.stat source, (err, stats) ->
8787
throw err if err and err.code isnt 'ENOENT'
8888
if err?.code is 'ENOENT'
89-
if topLevel and path.extname(source) not in coffee_exts
89+
if topLevel and source and path.extname(source) not in coffee_exts
9090
source = sources[sources.indexOf(source)] = "#{source}.coffee"
9191
return compilePath source, topLevel, base
9292
if topLevel

0 commit comments

Comments
 (0)