Sfoglia il codice sorgente

Only update notebook mime type if information is available.

Afshin Darian 8 anni fa
parent
commit
35a0f9cfbd
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  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') {