mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-3598: [Automation] NullPointerException observed while connecting agent
Description:
Fixing an NPE when setting resource count.
This commit is contained in:
parent
876a7b3361
commit
dfa612d1fe
|
|
@ -98,7 +98,7 @@ public class ResourceCountDaoImpl extends GenericDaoBase<ResourceCountVO, Long>
|
|||
@Override
|
||||
public void setResourceCount(long ownerId, ResourceOwnerType ownerType, ResourceType type, long count) {
|
||||
ResourceCountVO resourceCountVO = findByOwnerAndType(ownerId, ownerType, type);
|
||||
if (count != resourceCountVO.getCount()) {
|
||||
if (resourceCountVO != null && count != resourceCountVO.getCount()) {
|
||||
resourceCountVO.setCount(count);
|
||||
update(resourceCountVO.getId(), resourceCountVO);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue