1.fix NPE issue

main
Gary 10 months ago
parent 9f82107320
commit e003140fc7

@ -334,9 +334,11 @@ public class MyController extends BaseController {
AggregationResults<TotalCommentVo> results = mongoTemplate.aggregate(agg,"comment", TotalCommentVo.class);
TotalCommentVo totalCommentVo = results.getUniqueMappedResult();
userRespDTO.setThumbUpCount(totalCommentVo.getTotalThumbup());
userRespDTO.setCommentReplyCount(totalCommentVo.getTotalComment());
if(null != totalCommentVo) {
userRespDTO.setThumbUpCount(totalCommentVo.getTotalThumbup());
userRespDTO.setCommentReplyCount(totalCommentVo.getTotalComment());
}
return userRespDTO;
}
}

Loading…
Cancel
Save