Skip to content

Commit cfd4de1

Browse files
authored
Ensure to check if editor is undefined in nb diff view (microsoft#227174)
1 parent 231deb1 commit cfd4de1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/notebook/browser/diff/diffComponents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ export class DeletedElement extends SingleSideDiffElement {
10741074

10751075
layout(state: IDiffElementLayoutState) {
10761076
DOM.scheduleAtNextAnimationFrame(DOM.getWindow(this._diffEditorContainer), () => {
1077-
if (state.editorHeight || state.outerWidth) {
1077+
if ((state.editorHeight || state.outerWidth) && this._editor) {
10781078
this._editorContainer.style.height = `${this.cell.layoutInfo.editorHeight}px`;
10791079
this._editor.layout({
10801080
width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, false),
@@ -1254,7 +1254,7 @@ export class InsertElement extends SingleSideDiffElement {
12541254

12551255
layout(state: IDiffElementLayoutState) {
12561256
DOM.scheduleAtNextAnimationFrame(DOM.getWindow(this._diffEditorContainer), () => {
1257-
if (state.editorHeight || state.outerWidth) {
1257+
if ((state.editorHeight || state.outerWidth) && this._editor) {
12581258
this._editorContainer.style.height = `${this.cell.layoutInfo.editorHeight}px`;
12591259
this._editor.layout({
12601260
width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, false),

0 commit comments

Comments
 (0)