fix: 批量修改场景环境报错

This commit is contained in:
chenjianxing 2021-02-01 20:29:38 +08:00
parent 0f67b6fc9f
commit eb97cbeb25
1 changed files with 3 additions and 1 deletions

View File

@ -707,7 +707,9 @@ public class ApiAutomationService {
apiScenarios.forEach(item -> { apiScenarios.forEach(item -> {
JSONObject object = JSONObject.parseObject(item.getScenarioDefinition()); JSONObject object = JSONObject.parseObject(item.getScenarioDefinition());
object.put("environmentId", request.getEnvironmentId()); object.put("environmentId", request.getEnvironmentId());
item.setScenarioDefinition(JSONObject.toJSONString(object)); if (object != null) {
item.setScenarioDefinition(JSONObject.toJSONString(object));
}
apiScenarioMapper.updateByPrimaryKeySelective(item); apiScenarioMapper.updateByPrimaryKeySelective(item);
}); });
} }