Explorar o código

Guard against an inactive cell

Steven Silvester %!s(int64=8) %!d(string=hai) anos
pai
achega
62e71d4124
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/notebook/notebook/default-toolbar.ts

+ 3 - 0
src/notebook/notebook/default-toolbar.ts

@@ -356,6 +356,9 @@ class CellTypeSwitcher extends Widget {
    * Update the value of the dropdown from the widget state.
    */
   private _updateValue(widget: Notebook, select: HTMLSelectElement): void {
+    if (!widget.activeCell) {
+      return;
+    }
     let mType: string = widget.activeCell.model.type;
     for (let i = 0; i < widget.childCount(); i++) {
       let child = widget.childAt(i);