Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 61323c9

Browse files
authored
Merge pull request #122 from AtomLinter/arcanemagus/pathless-guard
Guard against pathless TextEditor
2 parents 6a2660c + 57f9322 commit 61323c9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export default {
2929
lintOnFly: true,
3030
lint: async (textEditor) => {
3131
const filePath = textEditor.getPath();
32+
if (!filePath) {
33+
// We somehow got called without a file path
34+
return null;
35+
}
3236
const fileText = textEditor.getText();
3337
const fileExtension = extname(filePath).substr(1);
3438

0 commit comments

Comments
 (0)