Merge branch 'v1.4'

This commit is contained in:
chenjianxing 2020-10-27 23:47:44 +08:00
commit 4dfc963c40

View File

@ -462,7 +462,15 @@ public class TestCaseService {
} else {
setp = steps;
}
JSONArray jsonArray = JSON.parseArray(setp);
JSONArray jsonArray = null;
try {
jsonArray = JSON.parseArray(setp);
} catch (Exception e) {
// 解决旧版本保存用例导出报错
setp.replace("\"desc\":,", "\"desc\":\"\",");
setp.replace("\"result\":}", "\"result\":\"\"}");
LogUtil.error(e.getMessage(), e);
}
for (int j = 0; j < jsonArray.size(); j++) {
int num = j + 1;
step.append(num + "." + jsonArray.getJSONObject(j).getString("desc") + "\n");