Explorar o código

PromiseAll增加undefined判断

huqi %!s(int64=5) %!d(string=hai) anos
pai
achega
537e777249
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;} };