Browse Source

Only update notebook mime type if information is available.

Afshin Darian 8 năm trước cách đây
mục cha
commit
35a0f9cfbd
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      src/notebook/widget.ts

+ 3 - 0
src/notebook/widget.ts

@@ -468,6 +468,9 @@ class StaticNotebook extends Widget {
    */
   private _updateMimetype(): void {
     let info = this._model.metadata.get('language_info') as nbformat.ILanguageInfoMetadata;
+    if (!info) {
+      return;
+    }
     this._mimetype = this._mimetypeService.getMimeTypeByLanguage(info);
     each(this.widgets, widget => {
       if (widget.model.type === 'code') {