Browse Source

Guard against an inactive cell

Steven Silvester 8 years ago
parent
commit
62e71d4124
1 changed files with 3 additions and 0 deletions
  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);