fix(测试跟踪): 用例导出步骤描述兼容旧数据
--bug=1020198 --user=陈建星 【测试跟踪】github#20007老版本升级新版本2.3.1后,测试用例--steps字段中未对预期结果为空时做兼容处理,导致测试用例导出报空指针错误 https://www.tapd.cn/55049933/s/1303458
This commit is contained in:
parent
109dd8cc27
commit
0d66e08f98
|
@ -1771,11 +1771,11 @@ public class TestCaseService {
|
|||
for (int j = 0; j < jsonArray.size(); j++) {
|
||||
// 将步骤存储起来,之后生成多条数据,再合并单元格
|
||||
Map item = (Map) jsonArray.get(j);
|
||||
String stepDesc = item.get("desc").toString();
|
||||
String stepResult = item.get("result").toString();
|
||||
String stepDesc = Optional.ofNullable(item.get("desc")).orElse(StringUtils.EMPTY).toString();
|
||||
String stepResult = Optional.ofNullable(item.get("result")).orElse(StringUtils.EMPTY).toString();
|
||||
if (StringUtils.isNotBlank(stepDesc) || StringUtils.isNotBlank(stepResult)) {
|
||||
stepDescList.add(Optional.ofNullable(stepDesc).orElse(StringUtils.EMPTY));
|
||||
stepResultList.add(Optional.ofNullable(stepResult).orElse(StringUtils.EMPTY));
|
||||
stepDescList.add(stepDesc);
|
||||
stepResultList.add(stepResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue