Jelajahi Sumber

PromiseAll增加undefined判断

huqi 5 tahun lalu
induk
melakukan
537e777249
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      o2web/source/o2_core/o2.js

+ 1 - 1
o2web/source/o2_core/o2.js

@@ -1869,7 +1869,7 @@ if (!window.Promise){
                 return { "then": function(s){ s(p); return this;} };
             }
         }else{
-            if (o2.typeOf(p.then)=="function"){
+            if (p && o2.typeOf(p.then)=="function"){
                 return Promise.resolve(p);
             }else{
                 return { "then": function(s){ s(p); return this;} };