From 99cf8fd4b81334e70bde46e79076270d71ff7fe6 Mon Sep 17 00:00:00 2001 From: jason <2353220944@qq.com> Date: Wed, 27 Nov 2024 21:25:51 +0800 Subject: [PATCH] fix npe --- .../apollo/internals/RemoteConfigRepository.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java index 93413ab6..259d1087 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java @@ -364,12 +364,14 @@ private List getConfigServices() { private Map mergeConfigurations(Map configurations,List configurationChanges) { Map newConfigurations = new HashMap<>(); - if (configurationChanges == null) { - return newConfigurations; - } if(configurations!=null){ Maps.newHashMap(configurations); } + + if (configurationChanges == null) { + return newConfigurations; + } + for (ConfigurationChange change : configurationChanges) { switch (change.getConfigurationChangeType()) { case ADDED: