mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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
|
@Override
|
||||||
public void setResourceCount(long ownerId, ResourceOwnerType ownerType, ResourceType type, long count) {
|
public void setResourceCount(long ownerId, ResourceOwnerType ownerType, ResourceType type, long count) {
|
||||||
ResourceCountVO resourceCountVO = findByOwnerAndType(ownerId, ownerType, type);
|
ResourceCountVO resourceCountVO = findByOwnerAndType(ownerId, ownerType, type);
|
||||||
if (count != resourceCountVO.getCount()) {
|
if (resourceCountVO != null && count != resourceCountVO.getCount()) {
|
||||||
resourceCountVO.setCount(count);
|
resourceCountVO.setCount(count);
|
||||||
update(resourceCountVO.getId(), resourceCountVO);
|
update(resourceCountVO.getId(), resourceCountVO);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user