Browse Source

Fail gracefully if path does not exist, e.g., if `jupyter lab` was started in a different directory.

Afshin Darian 8 years ago
parent
commit
36fbb3f145
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/filebrowser/plugin.ts

+ 2 - 1
src/filebrowser/plugin.ts

@@ -254,7 +254,8 @@ function addCommands(app: JupyterLab, fbWidget: FileBrowser, docManager: IDocume
     execute: args => {
       let path = args['path'] as string;
       let factory = args['factory'] as string || void 0;
-      return fbWidget.openPath(path, factory);
+      return docManager.services.contents.get(path)
+        .then(() => fbWidget.openPath(path, factory));
     }
   });