Skip to content

Commit dfa612d

Browse files
Vijayendra BhamidipatiSheng Yang
authored andcommitted
CLOUDSTACK-3598: [Automation] NullPointerException observed while connecting agent
Description: Fixing an NPE when setting resource count.
1 parent 876a7b3 commit dfa612d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public long getResourceCount(long ownerId, ResourceOwnerType ownerType, Resource
9898
@Override
9999
public void setResourceCount(long ownerId, ResourceOwnerType ownerType, ResourceType type, long count) {
100100
ResourceCountVO resourceCountVO = findByOwnerAndType(ownerId, ownerType, type);
101-
if (count != resourceCountVO.getCount()) {
101+
if (resourceCountVO != null && count != resourceCountVO.getCount()) {
102102
resourceCountVO.setCount(count);
103103
update(resourceCountVO.getId(), resourceCountVO);
104104
}

0 commit comments

Comments
 (0)