-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix NPE during public IP listing when a removed network or VPC ID is informed for associatenetworkid parameter #12372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.20
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ | |
| import javax.inject.Inject; | ||
| import javax.naming.ConfigurationException; | ||
|
|
||
| import com.cloud.network.vpc.VpcVO; | ||
| import org.apache.cloudstack.acl.ControlledEntity; | ||
| import org.apache.cloudstack.acl.SecurityChecker; | ||
| import org.apache.cloudstack.affinity.AffinityGroupProcessor; | ||
|
|
@@ -2580,12 +2581,21 @@ public Pair<List<? extends IpAddress>, Integer> searchForIPAddresses(final ListP | |
| } | ||
|
|
||
| if (associatedNetworkId != null) { | ||
| _accountMgr.checkAccess(caller, null, false, networkDao.findById(associatedNetworkId)); | ||
| sc.setParameters("associatedNetworkIdEq", associatedNetworkId); | ||
| NetworkVO associatedNetwork = networkDao.findById(associatedNetworkId); | ||
|
|
||
| if (associatedNetwork != null) { | ||
| _accountMgr.checkAccess(caller, null, false, associatedNetwork); | ||
| sc.setParameters("associatedNetworkIdEq", associatedNetworkId); | ||
| } | ||
| } | ||
|
|
||
| if (vpcId != null) { | ||
| _accountMgr.checkAccess(caller, null, false, _vpcDao.findById(vpcId)); | ||
| sc.setParameters("vpcId", vpcId); | ||
| VpcVO vpc = _vpcDao.findById(vpcId); | ||
|
|
||
| if (vpc != null) { | ||
| _accountMgr.checkAccess(caller, null, false, vpc); | ||
| sc.setParameters("vpcId", vpcId); | ||
| } | ||
erikbocks marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
erikbocks marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
2583
to
2599
|
||
|
|
||
| addrs = _publicIpAddressDao.search(sc, searchFilter); // Allocated | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.