Merge branch 'v1.4'

This commit is contained in:
chenjianxing 2020-10-27 23:47:44 +08:00
commit 4dfc963c40
1 changed files with 9 additions and 1 deletions

View File

@ -462,7 +462,15 @@ public class TestCaseService {
} else { } else {
setp = steps; 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++) { for (int j = 0; j < jsonArray.size(); j++) {
int num = j + 1; int num = j + 1;
step.append(num + "." + jsonArray.getJSONObject(j).getString("desc") + "\n"); step.append(num + "." + jsonArray.getJSONObject(j).getString("desc") + "\n");