From 9a5f5d224fdb7ac468d52b307e7d5549d40d637c Mon Sep 17 00:00:00 2001 From: Maddy <12754347+MaddyDev@users.noreply.github.com> Date: Fri, 17 Apr 2020 09:18:40 -0700 Subject: [PATCH] added proper check (#10032) --- .../workbench/contrib/notebook/browser/models/notebookInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/workbench/contrib/notebook/browser/models/notebookInput.ts b/src/sql/workbench/contrib/notebook/browser/models/notebookInput.ts index b2b346d4f0..334a799b99 100644 --- a/src/sql/workbench/contrib/notebook/browser/models/notebookInput.ts +++ b/src/sql/workbench/contrib/notebook/browser/models/notebookInput.ts @@ -300,7 +300,7 @@ export abstract class NotebookInput extends EditorInput { private async setTrustForNewEditor(newInput: IEditorInput | undefined): Promise { let model = this._model.getNotebookModel(); - if (model?.trustedMode && newInput?.resource !== this.resource) { + if (model?.trustedMode && newInput && newInput.resource !== this.resource) { await this.notebookService.serializeNotebookStateChange(newInput.resource, NotebookChangeType.Saved, undefined, true); } }