Skip to content

Commit 40d8c12

Browse files
authored
解决 calMoreImageInfo函数报错问题
报错: 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; }
1 parent 922de07 commit 40d8c12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wxParse/wxParse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function wxParseImgLoad(e) {
7070
// 假循环获取计算图片视觉最佳宽高
7171
function calMoreImageInfo(e, idx, that, bindName) {
7272
var temData = that.data[bindName];
73-
if (temData.images.length == 0) {
73+
if (!temData || temData.images.length == 0) {
7474
return;
7575
}
7676
var temImages = temData.images;

0 commit comments

Comments
 (0)