瀏覽代碼

Handle situation where `document` is set to `null` by an environment.

Afshin Darian 6 年之前
父節點
當前提交
4f405f90b1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/coreutils/src/pageconfig.ts

+ 1 - 1
packages/coreutils/src/pageconfig.ts

@@ -55,7 +55,7 @@ export namespace PageConfig {
     let found = false;
     let found = false;
 
 
     // Use script tag if available.
     // Use script tag if available.
-    if (typeof document !== 'undefined') {
+    if (typeof document !== 'undefined' && document) {
       const el = document.getElementById('jupyter-config-data');
       const el = document.getElementById('jupyter-config-data');
 
 
       if (el) {
       if (el) {