diff --git a/src/main/java/neatlogic/module/autoexec/api/service/MoveAutoexecServiceApi.java b/src/main/java/neatlogic/module/autoexec/api/service/MoveAutoexecServiceApi.java index 3cf68a4e54deb899faa3780b2fa13f5f11f16569..635982aac99bd959198d2f218a0049c366603dd6 100644 --- a/src/main/java/neatlogic/module/autoexec/api/service/MoveAutoexecServiceApi.java +++ b/src/main/java/neatlogic/module/autoexec/api/service/MoveAutoexecServiceApi.java @@ -78,12 +78,14 @@ public class MoveAutoexecServiceApi extends PrivateApiComponentBase { throw new MoveTargetNodeIllegalException(); } AutoexecServiceNodeVo moveServiceNode = autoexecServiceMapper.getAutoexecServiceNodeById(id); - AutoexecServiceNodeVo targetServiceNode = autoexecServiceMapper.getAutoexecServiceNodeById(targetId); if (moveServiceNode == null) { throw new AutoexecServiceNotFoundException(id); } - if (targetServiceNode == null) { - throw new AutoexecServiceNotFoundException(targetId); + if (targetId != 0L) { + AutoexecServiceNodeVo targetServiceNode = autoexecServiceMapper.getAutoexecServiceNodeById(targetId); + if (targetServiceNode == null) { + throw new AutoexecServiceNotFoundException(targetId); + } } LRCodeManager.moveTreeNode("autoexec_service", "id", "parent_id", id, MoveType.getMoveType(moveType), targetId);