steelbrain / intentions

Base package for showing intentions in Atom
MIT License
53 stars 11 forks source link

Check if `editor` is defined before trying to use it #52

Closed pfitzseb closed 7 years ago

pfitzseb commented 7 years ago

Basically the same as https://github.com/atom/atom/issues/12702 -- if a TextEditor isn't a PaneItem, atom.workspace.getActiveTextEditor() won't return it, which in turn breaks the following code.

This happens when using the ink console; I suppose we could just use mini-editors, but intentions still shouldn't break imho.

steelbrain commented 7 years ago

Thank You, do you think I should publish a release instantly or is it okay to include in the next release?

pfitzseb commented 7 years ago

Don't think it's necessary to tag a new release right away -- the Uncaught (in promise) TypeError: Cannot read property 'getPath' of undefined(…) are silent errors and only spam the console, so it shouldn't really detract from the UX. Thanks for the quick merge, btw!