mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
findbugs: use system account id instead of null (security considerations
to be made here)
This commit is contained in:
parent
fef2daf5d4
commit
ee1e8a6c2a
@ -449,7 +449,9 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
||||
volume.setPoolId(null);
|
||||
volume.setDataCenterId(zoneId);
|
||||
volume.setPodId(null);
|
||||
volume.setAccountId((owner == null) ? null : owner.getAccountId());
|
||||
// to prevent a nullpointer deref I put the system account id here when no owner is given.
|
||||
// TODO Decide if this is valid or whether throwing a CloudRuntimeException is more appropriate
|
||||
volume.setAccountId((owner == null) ? Account.ACCOUNT_ID_SYSTEM : owner.getAccountId());
|
||||
volume.setDomainId((owner == null) ? Domain.ROOT_DOMAIN : owner.getDomainId());
|
||||
long diskOfferingId = _diskOfferingDao.findByUniqueName("Cloud.com-Custom").getId();
|
||||
volume.setDiskOfferingId(diskOfferingId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user