Skip to content

Commit

Permalink
Fix erroring on a text editor with no path
Browse files Browse the repository at this point in the history
Under certain circumstances, it might be possible that Linter calls us on a text editor with no path. See #234 and https://github.com/AtomLinter/linter-eslint/blob/9eb5bbb2c771394b6bbe6aef172a4636cece9c4b/src/main.js#L220-L224.
  • Loading branch information
sonicdoe committed Oct 18, 2019
1 parent c672ab9 commit 7780e7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/linter-js-standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ module.exports = function (textEditor) {
var fileScope = textEditor.getGrammar().scopeName
var config = atom.config.get('linter-js-standard')

if (!filePath) {
return null
}

var opts = styleSettings.checkStyleSettings(filePath, textEditor)

opts.cwd = path.dirname(filePath)
Expand Down

0 comments on commit 7780e7c

Please sign in to comment.