Преглед изворни кода

PromiseAll增加undefined判断

huqi пре 5 година
родитељ
комит
537e777249
1 измењених фајлова са 1 додато и 1 уклоњено
  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;} };