Commit 12d3c0a9af9ba7733a10830f1b03ecaa965abae2

Authored by cherishsince
1 parent 99b6f240

【优化】AI 角色分类,处理 role 空情况

yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/model/AiChatRoleServiceImpl.java
... ... @@ -137,7 +137,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService {
137 137 @Override
138 138 public List<String> getChatRoleCategoryList() {
139 139 List<AiChatRoleDO> list = chatRoleMapper.selectListGroupByCategory(CommonStatusEnum.ENABLE.getStatus());
140   - return convertList(list, AiChatRoleDO::getCategory, role -> StrUtil.isNotBlank(role.getCategory()));
  140 + return convertList(list, AiChatRoleDO::getCategory, role -> role != null && StrUtil.isNotBlank(role.getCategory()));
141 141 }
142 142  
143 143 }
... ...