From 89e6ee9eff256d6de517e9db738b419187038a99 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 28 Apr 2025 14:51:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B4=A6=E5=8F=B7=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=AF=84=E8=AE=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/service/impl/MessageCenterServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/MessageCenterServiceImpl.java b/src/main/java/com/ai/da/service/impl/MessageCenterServiceImpl.java index 74a19386..b5e5a4f4 100644 --- a/src/main/java/com/ai/da/service/impl/MessageCenterServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/MessageCenterServiceImpl.java @@ -106,7 +106,11 @@ public class MessageCenterServiceImpl extends ServiceImpl convert = notificationPage.convert(o -> { NotificationVO notificationVO = CopyUtil.copyObject(o, NotificationVO.class); Account senderAccount = accountService.getById(notificationVO.getSenderId()); - notificationVO.setUserName(senderAccount.getUserName()); + if (Objects.nonNull(senderAccount)){ + notificationVO.setUserName(senderAccount.getUserName()); + }else { + notificationVO.setUserName("--"); + } // notificationVO.setSenderUserAvatar(StringUtils.isNullOrEmpty(senderAccount.getAvatar()) ? null : minioUtil.getPreSignedUrl(senderAccount.getAvatar(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); if (Objects.isNull(notificationVO.getPortfolioId())){ notificationVO.setPortfolioId(null);