harikrishna-patnala commented on code in PR #12706:
URL: https://github.com/apache/cloudstack/pull/12706#discussion_r3233382641
##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -5405,8 +5418,27 @@ public FirewallResponse
createIpv6FirewallRuleResponse(FirewallRule fwRule) {
response.setIcmpCode(fwRule.getIcmpCode());
response.setIcmpType(fwRule.getIcmpType());
- Network network = ApiDBUtils.findNetworkById(fwRule.getNetworkId());
- response.setNetworkId(network.getUuid());
+ Long networkId = fwRule.getNetworkId();
+ if (networkId != null) {
+ Network network = ApiDBUtils.findNetworkById(networkId);
+ if (network != null) {
+ response.setNetworkId(network.getUuid());
+ }
+ }
+
+ Long vpcId = fwRule.getVpcId();
+ if (vpcId == null && networkId != null) {
+ Network network = ApiDBUtils.findNetworkById(networkId);
+ if (network != null) {
+ vpcId = network.getVpcId();
+ }
+ }
Review Comment:
actually that raises another question, no need to check network in case of
vpc, I will just add VPC if it is set.
--
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]