Ensure to check if editor is undefined in nb diff view (#227174)
parent
231deb14cd
commit
cfd4de10ab
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue