You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ya...@apache.org on 2013/07/18 17:55:39 UTC
git commit: updated refs/heads/4.2 to 9edddf6
Updated Branches:
refs/heads/4.2 fbf38a35d -> 9edddf632
CLOUDSTACK-3598: [Automation] NullPointerException observed while connecting agent
Description:
Fixing an NPE when setting resource count.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9edddf63
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9edddf63
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9edddf63
Branch: refs/heads/4.2
Commit: 9edddf632f31212eb96f18a5e2276c2592825195
Parents: fbf38a3
Author: Vijayendra Bhamidipati <vi...@citrix.com>
Authored: Wed Jul 17 10:46:35 2013 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Thu Jul 18 08:55:31 2013 -0700
----------------------------------------------------------------------
.../src/com/cloud/configuration/dao/ResourceCountDaoImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9edddf63/engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java b/engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java
index cfd2137..9070ff9 100644
--- a/engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java
+++ b/engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java
@@ -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);
}