Skip to content

Commit e0ab763

Browse files
committed
fix: nonetype error when creating new folder
The new command uses the active view file name as the path from which to construct the new folder, but when the view is empty there is no real file on disk and the file name is None. The `os.path` functions like `isdir` and `exists` raise a NoneType exception when given None. This patch adds a NoneType check. Close braver#55 Re braver#56
1 parent 27ef796 commit e0ab763

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SideBar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def run(self, paths, context=""):
316316
source = self.get_path(paths)
317317
select_extension = False
318318

319-
if not os.path.exists(source):
319+
if source is None or not os.path.exists(source):
320320
self.window.status_message('No path to create a new file from.')
321321
return
322322

0 commit comments

Comments
 (0)