fix(用例管理): 修复用例详情里创建并关联缺陷时没有排除fieldId为空的选项

This commit is contained in:
CaptainB 2024-03-18 10:02:41 +08:00 committed by 刘瑞斌
parent 75ee36b0ea
commit aa2020b46a
1 changed files with 3 additions and 1 deletions

View File

@ -897,7 +897,9 @@ public class BugService {
*/
public void handleAndSaveCustomFields(BugEditRequest request, boolean merge) {
// 处理ID, 值的映射关系
Map<String, String> customFieldMap = request.getCustomFields().stream().collect(HashMap::new, (m, field) -> m.put(field.getId(), field.getValue()), HashMap::putAll);
Map<String, String> customFieldMap = request.getCustomFields().stream()
.filter(f -> StringUtils.isNotBlank(f.getId()))
.collect(HashMap::new, (m, field) -> m.put(field.getId(), field.getValue()), HashMap::putAll);
if (MapUtils.isEmpty(customFieldMap)) {
return;
}