From 1aa6efe3fc3babd2ae959597804a252605795fbb Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Wed, 10 Apr 2019 20:47:34 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=A4=84=E7=90=86=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E4=B8=BA=E7=A9=BA=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iocoder/mall/user/biz/service/UserAddressServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAddressServiceImpl.java b/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAddressServiceImpl.java index 70162c2fd..59ebbfb81 100644 --- a/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAddressServiceImpl.java +++ b/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAddressServiceImpl.java @@ -94,6 +94,9 @@ public class UserAddressServiceImpl implements UserAddressService { @Override public CommonResult getAddress(Integer userId, Integer id) { UserAddressDO userAddress = userAddressMapper.selectByUserIdAndId(userId, id); + if (userAddress == null) { + return ServiceExceptionUtil.error(UserErrorCodeEnum.USER_GET_ADDRESS_NOT_EXISTS.getCode()); + } if (DeletedStatusEnum.DELETED_YES.getValue().equals(userAddress.getDeleted())) { return ServiceExceptionUtil.error(UserErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode());