Ensure to check if editor is undefined in nb diff view (#227174)

don/issue207126
Don Jayamanne 2024-08-30 12:34:12 +10:00 committed by GitHub
parent 231deb14cd
commit cfd4de10ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

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