Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F42DC297 for ; Thu, 18 Jul 2013 15:56:05 +0000 (UTC) Received: (qmail 23668 invoked by uid 500); 18 Jul 2013 15:56:05 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 23606 invoked by uid 500); 18 Jul 2013 15:56:05 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 23599 invoked by uid 99); 18 Jul 2013 15:56:05 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 15:56:05 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DA82A8AD79E; Thu, 18 Jul 2013 15:56:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yasker@apache.org To: commits@cloudstack.apache.org Message-Id: <1cb3f4aeaddb43dfab7095071efda006@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to dfa612d Date: Thu, 18 Jul 2013 15:56:04 +0000 (UTC) Updated Branches: refs/heads/master 876a7b336 -> dfa612d1f 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/dfa612d1 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/dfa612d1 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/dfa612d1 Branch: refs/heads/master Commit: dfa612d1fe538274deea27f8a10ce8352aa39e5b Parents: 876a7b3 Author: Vijayendra Bhamidipati Authored: Wed Jul 17 10:46:35 2013 -0700 Committer: Sheng Yang Committed: Thu Jul 18 08:55:57 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/dfa612d1/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 @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); }