Commit 53d5c8dd authored by alex yao's avatar alex yao

fix:修复知识库查询为空时,NPE错误

parent a7de2561
...@@ -93,6 +93,9 @@ public class DemandKnowledgeServiceImpl implements DemandKnowledgeService { ...@@ -93,6 +93,9 @@ public class DemandKnowledgeServiceImpl implements DemandKnowledgeService {
if (null == searchKnowledgeResult) { if (null == searchKnowledgeResult) {
throw new I18nMessageException("exception/query.knowledge.base.exception"); throw new I18nMessageException("exception/query.knowledge.base.exception");
} }
if (CollectionUtils.isEmpty(searchKnowledgeResult.getDocuments())) {
return new ArrayList<String>();
}
return searchKnowledgeResult.getDocuments(); return searchKnowledgeResult.getDocuments();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment