Skip to content

Commit

Permalink
Don't assume view.sel() isn't empty in is_js_file
Browse files Browse the repository at this point in the history
Issue #133
  • Loading branch information
marijnh committed Sep 7, 2016
1 parent 5a09d70 commit bbcbfe1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tern.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
is_st2 = int(sublime.version()) < 3000

def is_js_file(view):
return view.score_selector(sel_end(view.sel()[0]), "source.js") > 0
return len(view.sel()) > 0 && view.score_selector(sel_end(view.sel()[0]), "source.js") > 0

files = {}
arghints_enabled = False
Expand Down

0 comments on commit bbcbfe1

Please sign in to comment.