diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index 16762c50137..9a363be7688 100644 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -391,9 +391,10 @@ public class SnapshotManagerImpl extends MutualExclusiveIdsManagerBase implement SnapshotVO snapshot = _snapshotDao.findById(snapshotId); if (policyId != Snapshot.MANUAL_POLICY_ID) { SnapshotScheduleVO snapshotSchedule = _snapshotScheduleDao.getCurrentSchedule(volumeId, policyId, true); - assert snapshotSchedule != null; - snapshotSchedule.setSnapshotId(snapshotId); - _snapshotScheduleDao.update(snapshotSchedule.getId(), snapshotSchedule); + if (snapshotSchedule !=null) { + snapshotSchedule.setSnapshotId(snapshotId); + _snapshotScheduleDao.update(snapshotSchedule.getId(), snapshotSchedule); + } } if (snapshot != null && snapshot.isRecursive()) {