mirror of
https://gitee.com/ZhongBangKeJi/crmeb_java.git
synced 2026-04-26 20:49:37 +08:00
解决异常数据导致文章访问500
This commit is contained in:
@@ -134,6 +134,9 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleDao, Article> impleme
|
|||||||
@Override
|
@Override
|
||||||
public ArticleVo getVoByFront(Integer id) {
|
public ArticleVo getVoByFront(Integer id) {
|
||||||
Article article = getById(id);
|
Article article = getById(id);
|
||||||
|
if(null == article){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if(article.getStatus()){
|
if(article.getStatus()){
|
||||||
return null;
|
return null;
|
||||||
@@ -147,7 +150,9 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleDao, Article> impleme
|
|||||||
|
|
||||||
//分类名称
|
//分类名称
|
||||||
Category category = categoryService.getById(article.getCid());
|
Category category = categoryService.getById(article.getCid());
|
||||||
articleVo.setCategoryName(category.getName());
|
if(null != category){
|
||||||
|
articleVo.setCategoryName(category.getName());
|
||||||
|
}
|
||||||
return articleVo;
|
return articleVo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user