Skip to content

Commit bbcbfe1

Browse files
committed
Don't assume view.sel() isn't empty in is_js_file
Issue #133
1 parent 5a09d70 commit bbcbfe1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tern.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
is_st2 = int(sublime.version()) < 3000
1414

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

1818
files = {}
1919
arghints_enabled = False

0 commit comments

Comments
 (0)