cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlsoren...@apache.org
Subject git commit: updated refs/heads/master to e731722
Date Tue, 09 Jul 2013 15:48:41 GMT
Updated Branches:
  refs/heads/master 3e7cebee2 -> e73172226


CLOUDSTACK-3422 - fix null pointer in usage and action events when
deleting resources whose account has been removed


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e7317222
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e7317222
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e7317222

Branch: refs/heads/master
Commit: e731722263feaff5204f4bba45d3e85c100cbd47
Parents: 3e7cebe
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Tue Jul 9 09:37:23 2013 -0600
Committer: Marcus Sorensen <marcus@betterservers.com>
Committed: Tue Jul 9 09:48:24 2013 -0600

----------------------------------------------------------------------
 server/src/com/cloud/event/ActionEventUtils.java | 5 +++++
 server/src/com/cloud/event/UsageEventUtils.java  | 4 ++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7317222/server/src/com/cloud/event/ActionEventUtils.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/event/ActionEventUtils.java b/server/src/com/cloud/event/ActionEventUtils.java
index a2d4906..eb3efed 100755
--- a/server/src/com/cloud/event/ActionEventUtils.java
+++ b/server/src/com/cloud/event/ActionEventUtils.java
@@ -161,6 +161,11 @@ public class ActionEventUtils {
         Map<String, String> eventDescription = new HashMap<String, String>();
         Account account = _accountDao.findById(accountId);
         User user = _userDao.findById(userId);
+        // if account has been deleted, this might be called during cleanup of resources
and results in null pointer
+        if (account == null)
+            return;
+        if (user == null)
+            return;
         eventDescription.put("user", user.getUuid());
         eventDescription.put("account", account.getUuid());
         eventDescription.put("event", eventType);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7317222/server/src/com/cloud/event/UsageEventUtils.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/event/UsageEventUtils.java b/server/src/com/cloud/event/UsageEventUtils.java
index 5401244..2d92fae 100644
--- a/server/src/com/cloud/event/UsageEventUtils.java
+++ b/server/src/com/cloud/event/UsageEventUtils.java
@@ -124,6 +124,10 @@ public class UsageEventUtils {
         Account account = _accountDao.findById(accountId);
         DataCenterVO dc = _dcDao.findById(zoneId);
 
+        // if account has been deleted, this might be called during cleanup of resources
and results in null pointer
+        if (account == null)
+            return;
+
         Event event = new Event(ManagementServer.Name, EventCategory.USAGE_EVENT.getName(),
usageEventType,
                 resourceType, resourceUUID);
 


Mime
View raw message