Authored by 郝肖肖

判断返回的对象是否存在

@@ -184,7 +184,7 @@ const search = (req, res, next) => { @@ -184,7 +184,7 @@ const search = (req, res, next) => {
184 184
185 params.isApp = req.yoho.isApp; 185 params.isApp = req.yoho.isApp;
186 searchModel.getSearchData(params).then((result) => { 186 searchModel.getSearchData(params).then((result) => {
187 - if (result.list.length > 0) { 187 + if (result.list && result.list.length > 0) {
188 res.render('search/page', { 188 res.render('search/page', {
189 layout: false, 189 layout: false,
190 new: result.list, 190 new: result.list,