diff --git a/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.ts b/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.ts index b1d030fb632..3369f353b3c 100644 --- a/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.ts +++ b/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.ts @@ -559,6 +559,15 @@ export class NotebookTextModel extends Disposable implements INotebookTextModel } private _customMetadataEqual(a: any, b: any) { + if (!a && !b) { + // both of them are nullish or undefined + return true; + } + + if (!a || !b) { + return false; + } + const aProps = Object.getOwnPropertyNames(a); const bProps = Object.getOwnPropertyNames(b);