mirror of
https://github.com/apache/cloudstack
synced 2026-09-02 01:31:09 +00:00
handle empty snapshot correctly
This commit is contained in:
parent
0eb468ca90
commit
42a3f0041a
@ -750,7 +750,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
||||
SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
|
||||
if (snapshot.getBackupSnapshotId() != null) {
|
||||
List<SnapshotVO> snaps = _snapshotDao.listByBackupUuid(snapshot.getVolumeId(), snapshot.getBackupSnapshotId());
|
||||
if (!snaps.isEmpty()) {
|
||||
if ( snaps != null && snaps.size() > 1 ) {
|
||||
snapshot.setBackupSnapshotId(null);
|
||||
_snapshotDao.update(snapshot.getId(), snapshot);
|
||||
}
|
||||
@ -787,7 +787,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
||||
String BackupSnapshotId = lastSnapshot.getBackupSnapshotId();
|
||||
if (BackupSnapshotId != null) {
|
||||
List<SnapshotVO> snaps = _snapshotDao.listByBackupUuid(lastSnapshot.getVolumeId(), BackupSnapshotId);
|
||||
if (snaps != null && !snaps.isEmpty()) {
|
||||
if ( snaps != null && snaps.size() > 1) {
|
||||
lastSnapshot.setBackupSnapshotId(null);
|
||||
_snapshotDao.update(lastSnapshot.getId(), lastSnapshot);
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user