fix:判空问题

This commit is contained in:
dzc committed 2026-05-13 10:04:18 +08:00
1 parent 1e2aa98c97
commit 00287ca3b7
1 file changed
+1 -1
@@ -104,7 +104,7 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
log.info("|{}|创建用户电子钱包失败,userId:{},用户id不存在", TAG, userId);
return;
}
String role = Arrays.stream(user.getRoleCodes()).filter(v -> ObjectUtil.equals(v, autoWalletRoleCode)).findFirst().get();
String role = Arrays.stream(user.getRoleCodes()).filter(v -> ObjectUtil.equals(v, autoWalletRoleCode)).findFirst().orElse(null);
if (ObjectUtil.isEmpty(role)) {
log.info("|{}|创建用户电子钱包失败,userId:{},没有{}权限", TAG, userId, "WALLET_AUTO_CREATE");
return;