소스 검색

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

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())
         );