Initialize cell source to empty array if notebook file's source is undefined. (#8189)

This commit is contained in:
Cory Rivera
2019-11-04 10:38:14 -08:00
committed by GitHub
parent 76e8805a6b
commit 3c702c15e2

View File

@@ -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