浏览代码

根据书号查询教材管理信息,解决空指针报错问题

dzx 1 年之前
父节点
当前提交
1968503ef1
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java

+ 3 - 0
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java

@@ -451,6 +451,9 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
     @Override
     public TextbookVo getInfoByissn(String issn) {
         TextbookVo infoByissn = textbookTextbookMapper.getInfoByissn(issn);
+        if(infoByissn == null){
+            return null;
+        }
         List<TextbookClassRelation> classRelationList = textbookTextbookClassRelationMapper.selectList(
                 new QueryWrapper<TextbookClassRelation>().lambda().eq(TextbookClassRelation::getTextbookId, infoByissn.getId())
         );