Skip to content

Commit

Permalink
Merge pull request #5683 from TheAlphaNerd/validate-before-using-path
Browse files Browse the repository at this point in the history
fix: don't use path.extname with undefined value
  • Loading branch information
ilyavolodin committed Mar 27, 2016
2 parents 5737417 + c41fab9 commit 21bd441
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cli-engine.js
Expand Up @@ -140,13 +140,14 @@ function processText(text, configHelper, filename, fix, allowInlineConfig) {
config,
messages,
stats,
fileExtension = path.extname(filename),
fileExtension,
processor,
loadedPlugins,
fixedResult;

if (filename) {
filePath = path.resolve(filename);
fileExtension = path.extname(filename);
}

filename = filename || "<text>";
Expand Down

0 comments on commit 21bd441

Please sign in to comment.