This repository was archived by the owner on Aug 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -44,18 +44,29 @@ export default {
4444 scope : 'file' ,
4545 lintOnFly : true ,
4646 lint : ( textEditor ) => {
47+ if ( ! atom . workspace . isTextEditor ( textEditor ) ) {
48+ return null ;
49+ }
50+
4751 const filePath = textEditor . getPath ( ) ;
52+ if ( ! filePath ) {
53+ // TextEditor has no path associated with it (yet)
54+ return null ;
55+ }
56+
4857 const fileExt = path . extname ( filePath ) ;
4958 if ( fileExt === '.zsh' || fileExt === '.zsh-theme' ) {
5059 // shellcheck does not support zsh
5160 return [ ] ;
5261 }
62+
5363 const text = textEditor . getText ( ) ;
5464 const cwd = path . dirname ( filePath ) ;
5565 const showAll = this . enableNotice ;
5666 // The first -f parameter overrides any others
5767 const parameters = [ ] . concat ( [ '-f' , 'gcc' ] , this . userParameters , [ '-' ] ) ;
5868 const options = { stdin : text , cwd, ignoreExitCode : true } ;
69+
5970 return helpers . exec ( this . executablePath , parameters , options ) . then ( ( output ) => {
6071 if ( textEditor . getText ( ) !== text ) {
6172 // The text has changed since the lint was triggered, tell Linter not to update
You can’t perform that action at this time.
0 commit comments