You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2015/09/11 12:17:13 UTC

[3/4] git commit: updated refs/heads/master to d807403

Fix coverity scan 1323172


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

Branch: refs/heads/master
Commit: c15729e71afb582d300c608f6b230af15a7d1958
Parents: e586d11
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Wed Sep 9 14:57:58 2015 +0200
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Thu Sep 10 08:01:36 2015 +0200

----------------------------------------------------------------------
 .../apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c15729e7/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
index a9aad0a..f7f044f 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
@@ -409,6 +409,9 @@ public class SnapshotServiceImpl implements SnapshotService {
     @Override
     public boolean revertSnapshot(SnapshotInfo snapshot) {
         SnapshotInfo snapshotOnPrimaryStore = _snapshotFactory.getSnapshot(snapshot.getId(), DataStoreRole.Primary);
+        if (snapshotOnPrimaryStore == null) {
+            throw new CloudRuntimeException("Cannot find an entry for snapshot " + snapshot.getId() + " on primary storage pools");
+        }
         PrimaryDataStore store = (PrimaryDataStore)snapshotOnPrimaryStore.getDataStore();
 
         AsyncCallFuture<SnapshotResult> future = new AsyncCallFuture<SnapshotResult>();