Skip to content

Commit

Permalink
Add guard in case Atom passes no valid TextEditor ID
Browse files Browse the repository at this point in the history
Closes #468
skip ci
  • Loading branch information
sthub1 committed Jan 24, 2018
1 parent bb2c165 commit d6ddb84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports =
@textEditors[textEditor.id].add textEditor.observeGrammar (grammar) =>
# Instantiate indentor for language-babel files
if textEditor.getGrammar().packageName is LB
@textEditors[textEditor.id].autoIndent = new AutoIndent(textEditor)
@textEditors[textEditor.id]?.autoIndent = new AutoIndent(textEditor)
else
@textEditors[textEditor.id]?.autoIndent?.destroy()
delete @textEditors[textEditor.id]?.autoIndent?
Expand Down

0 comments on commit d6ddb84

Please sign in to comment.