diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java index 925d01bd09..2d0743a5ab 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java @@ -76,6 +76,11 @@ public class WorkerGroupService extends BaseService { WorkerGroup workerGroup = null; if(id != 0){ workerGroup = workerGroupMapper.selectById(id); + //check exist + if (workerGroup == null){ + workerGroup = new WorkerGroup(); + workerGroup.setCreateTime(now); + } }else{ workerGroup = new WorkerGroup(); workerGroup.setCreateTime(now);