修复进入商品详情加载商品评论时,因评论用户信息不存在的情况导致的NullPoint异常。 (#148)

This commit is contained in:
gitrocyang
2019-03-30 21:22:58 +08:00
committed by linlinjava
parent 8219d12fdb
commit 983a858bb3

View File

@@ -130,8 +130,8 @@ public class WxGoodsController {
c.put("addTime", comment.getAddTime());
c.put("content", comment.getContent());
LitemallUser user = userService.findById(comment.getUserId());
c.put("nickname", user.getNickname());
c.put("avatar", user.getAvatar());
c.put("nickname", user == null ? "" : user.getNickname());
c.put("avatar", user == null ? "" : user.getAvatar());
c.put("picList", comment.getPicUrls());
commentsVo.add(c);
}