Copilot commented on code in PR #13032:
URL: https://github.com/apache/cloudstack/pull/13032#discussion_r3551344541


##########
server/src/main/java/com/cloud/network/NetworkModelImpl.java:
##########
@@ -1953,7 +2189,7 @@ public List<Provider> getNtwkOffDistinctProviders(long 
ntkwOffId) {
         List<String> providerNames = 
_ntwkOfferingSrvcDao.getDistinctProviders(ntkwOffId);
         List<Provider> providers = new ArrayList<Provider>();
         for (String providerName : providerNames) {
-            providers.add(Network.Provider.getProvider(providerName));
+            providers.add(resolveProvider(providerName));
         }

Review Comment:
   getNtwkOffDistinctProviders() adds the result of resolveProvider() without a 
null-check. If an offering contains a provider name that can no longer be 
resolved (e.g. an extension-backed provider that was removed/renamed), this 
will insert null into the returned list and can trigger NullPointerExceptions 
in callers that do provider.getName() (e.g. 
VpcManagerImpl.validateNtwkOffForVpc).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to