Daniel Erez has uploaded a new change for review.

Change subject: core: RemoveDiskSnapshots - verify image existence
......................................................................

core: RemoveDiskSnapshots - verify image existence

RemoveDiskSnapshotsCommand -> getImages():
Ensure image existence in DB before adding into images list
(to avoid adding null to the list).

Change-Id: I06fd2062b8c359d2abd7e64e559d1d82197e0d76
Bug-Url: https://bugzilla.redhat.com/1134866
Signed-off-by: Daniel Erez <de...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskSnapshotsCommand.java
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/18/33618/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskSnapshotsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskSnapshotsCommand.java
index 839b7dd..34f408c 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskSnapshotsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskSnapshotsCommand.java
@@ -86,7 +86,11 @@
                     // Disks existence is validated in canDoAction
                     continue;
                 }
-                images.add(getDiskImageDao().getSnapshotById(imageId));
+
+                DiskImage image = getDiskImageDao().getSnapshotById(imageId);
+                if (image != null) {
+                    images.add(image);
+                }
             }
         }
         return images;


-- 
To view, visit http://gerrit.ovirt.org/33618
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I06fd2062b8c359d2abd7e64e559d1d82197e0d76
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Daniel Erez <de...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to