CLOUDSTACK-3514: [Automation] Vmware - Failed to download default template for first zone

Description:

    Fixing reference to null object.
This commit is contained in:
Vijayendra Bhamidipati 2013-07-15 11:54:34 -07:00 committed by Sheng Yang
parent 13c1c6291c
commit e18ca0117d
1 changed files with 3 additions and 1 deletions

View File

@ -811,7 +811,9 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim
_resourceCountDao.lockRows(sc, null, true);
ResourceCountVO accountRC = _resourceCountDao.findByOwnerAndType(accountId, ResourceOwnerType.Account, type);
long oldCount = accountRC.getCount();
long oldCount = 0;
if (accountRC != null)
oldCount = accountRC.getCount();
if (type == Resource.ResourceType.user_vm) {
newCount = _userVmDao.countAllocatedVMsForAccount(accountId);