浏览代码

修复promiseAll方法为空数组时的问题

huqi 5 年之前
父节点
当前提交
533e1477bd
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      o2web/source/o2_core/o2.js

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

@@ -1862,7 +1862,7 @@ if (!window.Promise){
 
 
     var _promiseAll = function(p){
     var _promiseAll = function(p){
         if (o2.typeOf(p)=="array"){
         if (o2.typeOf(p)=="array"){
-            if (p.some(function(e){ return (o2.typeOf(e.then)=="function") })){
+            if (p.some(function(e){ return (e && o2.typeOf(e.then)=="function") })){
                 return Promise.all(p);
                 return Promise.all(p);
             }else{
             }else{
                 return { "then": function(s){ s(p); return this;} };
                 return { "then": function(s){ s(p); return this;} };