angular-ui / AngularJS-sublime-package

AngularJS code completion, snippets, go to definition, quick panel search, and more.
MIT License
1.42k stars 169 forks source link

Error after close all tabs #39

Closed max-mykhailenko closed 11 years ago

max-mykhailenko commented 11 years ago

How to repeat bug

  1. Run Sublime without opened tabs.
  2. Find some factory or controller by ctrl+command+l and open file in tab.
  3. Close tab and try press ctrl+command+l

Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublimeplugin.py", line 526, in run return self.run() File "AngularJS-sublime-package in /Users/max/Library/Application Support/Sublime Text 3/Installed Packages/AngularJS.sublime-package", line 462, in run File "AngularJS-sublime-package in /Users/max/Library/Application Support/Sublime Text 3/Installed Packages/AngularJS.sublime-package", line 42, in get_folders File "AngularJS-sublime-package in /Users/max/Library/Application Support/Sublime Text 3/Installed Packages/AngularJS.sublime-package", line 33, in view_settings AttributeError: 'NoneType' object has no attribute 'settings' Exception in thread Thread-43: Traceback (most recent call last): File "X/threading.py", line 639, in _bootstrap_inner File "X/threading.py", line 825, in run File "/Users/max/Library/Application Support/Sublime Text 3/Packages/JSHint Gutter/JSHint.py", line 204, in self.timer = Timer(1, lambda: view.window().run_command("jshint", { "show_panel": False })) AttributeError: 'NoneType' object has no attribute 'run_command'

subhaze commented 11 years ago

Seems like ST2/3 use different methods, under the hood, on returning a view object. I can't reproduce this in ST3 but was able to in ST2. I've added a check to ensure there is a view available before processing the command.