From 6d4a3410c86feed171063b760aa4b504662c75a2 Mon Sep 17 00:00:00 2001 From: samz406 Date: Mon, 30 Dec 2019 10:31:35 +0800 Subject: [PATCH] modify saveWorkerGroup may NPE (#1629) * User update not check params * user phone update when noteEmpty * modify saveWorkerGroup may NPE --- .../dolphinscheduler/api/service/WorkerGroupService.java | 5 +++++ 1 file changed, 5 insertions(+) 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);