You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2014/07/25 01:59:16 UTC

git commit: updated refs/heads/master to 165618a

Repository: cloudstack
Updated Branches:
  refs/heads/master e15c20ec0 -> 165618ac9


CLOUDSTACK-7166: fix NPE


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

Branch: refs/heads/master
Commit: 165618ac9ac2937fbb1d7ff0da89de1abba4ccc1
Parents: e15c20e
Author: Edison Su <su...@gmail.com>
Authored: Thu Jul 24 16:58:30 2014 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Thu Jul 24 16:58:30 2014 -0700

----------------------------------------------------------------------
 server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/165618ac/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
index a8b7e5f..76ab370 100755
--- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
+++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
@@ -623,7 +623,9 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
                 if (snapshotStrategy.deleteSnapshot(snapshot.getId())) {
                     if (Type.MANUAL == snapshot.getRecurringType()) {
                         _resourceLimitMgr.decrementResourceCount(accountId, ResourceType.snapshot);
-                        _resourceLimitMgr.decrementResourceCount(accountId, ResourceType.secondary_storage, new Long(snapshotStoreRef.getSize()));
+                        if  (snapshotStoreRef != null) {
+                            _resourceLimitMgr.decrementResourceCount(accountId, ResourceType.secondary_storage, new Long(snapshotStoreRef.getSize()));
+                        }
                     }
 
                     // Log event after successful deletion