From 8877d740345ebe63ab1b78918c1c483e18cbb8e7 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Wed, 4 Nov 2020 16:28:59 -0800 Subject: [PATCH] Check for clientSession before property (#13198) --- src/sql/workbench/contrib/notebook/browser/notebookActions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/contrib/notebook/browser/notebookActions.ts b/src/sql/workbench/contrib/notebook/browser/notebookActions.ts index 45a9d0823a..71c302cc1f 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebookActions.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebookActions.ts @@ -338,7 +338,7 @@ export class KernelsDropdown extends SelectBox { } this.setOptions(kernels, index); } - } else if (this.model.clientSession.isInErrorState) { + } else if (this.model.clientSession?.isInErrorState) { kernels.unshift(noKernelName); this.setOptions(kernels, 0); } @@ -402,7 +402,7 @@ export class AttachToDropdown extends SelectBox { let kernelDisplayName: string = this.getKernelDisplayName(); if (kernelDisplayName) { this.loadAttachToDropdown(this.model, kernelDisplayName, showSelectConnection); - } else if (this.model.clientSession.isInErrorState) { + } else if (this.model.clientSession?.isInErrorState) { this.setOptions([localize('noContextAvailable', "None")], 0); } }