From 3c702c15e2820b2227d4b583b955f1b2ff2f7d3d Mon Sep 17 00:00:00 2001 From: Cory Rivera Date: Mon, 4 Nov 2019 10:38:14 -0800 Subject: [PATCH] Initialize cell source to empty array if notebook file's source is undefined. (#8189) --- src/sql/workbench/parts/notebook/browser/models/cell.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sql/workbench/parts/notebook/browser/models/cell.ts b/src/sql/workbench/parts/notebook/browser/models/cell.ts index c52e41fe80..b2bed049a8 100644 --- a/src/sql/workbench/parts/notebook/browser/models/cell.ts +++ b/src/sql/workbench/parts/notebook/browser/models/cell.ts @@ -674,6 +674,9 @@ export class CellModel implements ICellModel { private getMultilineSource(source: string | string[]): string | string[] { + if (source === undefined) { + return []; + } if (typeof source === 'string') { let sourceMultiline = source.split('\n'); // If source is one line (i.e. no '\n'), return it immediately