From edb9d8b3bd9ecbb373c6db9e7f3cd3306ccad98b Mon Sep 17 00:00:00 2001 From: yangzl Date: Sat, 23 Nov 2024 21:39:39 +0800 Subject: [PATCH] fix(portal): Optimized the robustness of the code --- .../ctrip/framework/apollo/openapi/service/ConsumerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/service/ConsumerService.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/service/ConsumerService.java index fc44e76a69d..100d3de9c7b 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/service/ConsumerService.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/service/ConsumerService.java @@ -262,7 +262,7 @@ private List getRateLimit(List consumerIdList) { List list = new ArrayList<>(consumerIdList.size()); for (Long consumerId : consumerIdList) { ConsumerToken consumerToken = consumerTokenRepository.findByConsumerId(consumerId); - Integer rateLimit = consumerToken.getRateLimit(); + Integer rateLimit = consumerToken != null ? consumerToken.getRateLimit() : 0; list.add(rateLimit); }