Skip to content

Commit

Permalink
解决 calMoreImageInfo函数报错问题
Browse files Browse the repository at this point in the history
报错:
Cannot read property 'images' of undefined;at "pages/detail/detail" page wxParseImgLoad function
TypeError: Cannot read property 'images' of undefined

加了个不存在的return情况 
if (!temData || temData.images.length == 0) {
    return;
  }
  • Loading branch information
webber007 authored May 17, 2017
1 parent 922de07 commit 40d8c12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wxParse/wxParse.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function wxParseImgLoad(e) {
// 假循环获取计算图片视觉最佳宽高
function calMoreImageInfo(e, idx, that, bindName) {
var temData = that.data[bindName];
if (temData.images.length == 0) {
if (!temData || temData.images.length == 0) {
return;
}
var temImages = temData.images;
Expand Down

0 comments on commit 40d8c12

Please sign in to comment.