Permalink
Browse files

Merge pull request #23 from jbergknoff/master

Fix crash when working directory ceases to exist
  • Loading branch information...
hmml committed Feb 9, 2014
2 parents 4089119 + 199c742 commit cf8db2bdd0115f121b2334d41448d51e3f0daa15
Showing with 8 additions and 4 deletions.
  1. +8 −4 sublime_files.py
View
@@ -13,10 +13,14 @@
class SublimeFilesCommand(sublime_plugin.WindowCommand):
def getcwd(self):
- if running_in_st3():
- return os.getcwd()
- else:
- return os.getcwdu()
+ try:
+ if running_in_st3():
+ return os.getcwd()
+ else:
+ return os.getcwdu()
+ except OSError:
+ os.chdir(os.getenv(self.home))
+ return self.getcwd()
def show_quick_panel(self, elements, on_selection, params):
sublime.set_timeout(lambda: self.window.show_quick_panel(elements, on_selection, params), 10)

0 comments on commit cf8db2b

Please sign in to comment.