From 833dbda7e6e5aecc687aa0f4c7dceb31187c4cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Fri, 17 Feb 2023 11:34:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E9=83=A8=E9=97=A8id=E6=97=A0=E6=B3=95=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=88=B0=E9=83=A8=E9=97=A8=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index b6736ec7..5575b94c 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -115,6 +115,9 @@ public class SysDeptServiceImpl implements ISysDeptService { @Override public SysDept selectDeptById(Long deptId) { SysDept dept = baseMapper.selectById(deptId); + if (ObjectUtil.isNull(dept)) { + return null; + } SysDept parentDept = baseMapper.selectOne(new LambdaQueryWrapper() .select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId())); dept.setParentName(ObjectUtil.isNotNull(parentDept) ? parentDept.getDeptName() : null);