From d9a83fd41d66aa47cf2f2b2b2448bfb24893cb7e Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 26 Oct 2022 19:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=BD=E5=8A=9B=E4=B8=8B=E6=9E=B6=20npe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TResourceMountApplyController.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java index 803a2247..1464eed4 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java @@ -68,11 +68,13 @@ public class TResourceMountApplyController { // @RequiresPermissions("resourceMountApply:tresourcemountapply:info") public Result get(@PathVariable("id") Long id) { TResourceMountApplyDTO data = tResourceMountApplyService.get(id); - SysDeptDTO sysDeptDTO = sysDeptService.get(Long.valueOf(data.getDeptId())); - if (sysDeptDTO != null) { - ResourceDTO resourceDTO = data.getResourceDTO(); - resourceDTO.setDeptName(sysDeptDTO.getName()); - data.setResourceDTO(resourceDTO); + if (data.getDeptId() != null) { + SysDeptDTO sysDeptDTO = sysDeptService.get(Long.valueOf(data.getDeptId())); + if (sysDeptDTO != null) { + ResourceDTO resourceDTO = data.getResourceDTO(); + resourceDTO.setDeptName(sysDeptDTO.getName()); + data.setResourceDTO(resourceDTO); + } } return new Result().ok(data); }