Fix #3937 Create new notebook (Mac) and receive TypeError (#3965)

- Handles empty file scenario, with fixes along the way for missing metadata (bonus win)
- In non-empty file still shows error and kernel stuck in loading state. #3964 opened to track this issue and fix later
This commit is contained in:
Kevin Cunnane
2019-02-07 10:35:19 -08:00
committed by GitHub
parent 40e0d5cfbf
commit 69dff5a2cb
3 changed files with 49 additions and 23 deletions

View File

@@ -101,7 +101,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
}
private updateProfile(): void {
this.profile = this.notebookParams!.profile;
this.profile = this.notebookParams ? this.notebookParams.profile : undefined;
if (!this.profile) {
// use global connection if possible
let profile = TaskUtilities.getCurrentGlobalConnection(this.objectExplorerService, this.connectionManagementService, this.editorService);