Просмотр исходного кода

PromiseAll增加undefined判断

huqi 5 лет назад
Родитель
Сommit
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;} };
                 return { "then": function(s){ s(p); return this;} };
             }
             }
         }else{
         }else{
-            if (o2.typeOf(p.then)=="function"){
+            if (p && o2.typeOf(p.then)=="function"){
                 return Promise.resolve(p);
                 return Promise.resolve(p);
             }else{
             }else{
                 return { "then": function(s){ s(p); return this;} };
                 return { "then": function(s){ s(p); return this;} };