Browse Source

Better falsiness.

Ian Rose 6 years ago
parent
commit
85e78948bf

+ 2 - 2
packages/notebook-extension/src/index.ts

@@ -302,7 +302,7 @@ export const commandEditItem: JupyterLabPlugin<void> = {
     // Keep the status item up-to-date with the current notebook.
     tracker.currentChanged.connect(() => {
       const current = tracker.currentWidget;
-      item.model.notebook = current.content;
+      item.model.notebook = current && current.content;
     });
 
     statusBar.registerStatusItem('command-edit-item', item, {
@@ -333,7 +333,7 @@ export const notebookTrustItem: JupyterLabPlugin<void> = {
     // Keep the status item up-to-date with the current notebook.
     tracker.currentChanged.connect(() => {
       const current = tracker.currentWidget;
-      item.model.notebook = current.content;
+      item.model.notebook = current && current.content;
     });
 
     statusBar.registerStatusItem('notebook-trust-item', item, {

+ 1 - 1
packages/statusbar/src/defaults/lineCol.tsx

@@ -303,7 +303,7 @@ export namespace LineCol {
 
       const oldState = this._getAllState();
       this._editor = editor;
-      if (this._editor === null) {
+      if (!this._editor) {
         this._column = 1;
         this._line = 1;
       } else {