Skip to content

Commit

Permalink
fix: volume might be nil when returning an error
Browse files Browse the repository at this point in the history
`volume` might be nil when returning an erorr of the function
`loadVolume` and `deltaOps.UpdateBackupStatus` needs `volume.Name`
when leaving the function.

Signed-off-by: James Lu <[email protected]>
  • Loading branch information
mantissahz committed Mar 5, 2024
1 parent 1f642a5 commit f079ca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deltablock.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func CreateDeltaBlockBackup(backupName string, config *DeltaBackupConfig) (isInc
defer func() {
if err != nil {
log.WithError(err).Error("Failed to create delta block backup")
deltaOps.UpdateBackupStatus(snapshot.Name, volume.Name, string(types.ProgressStateError), 0, "", err.Error())
deltaOps.UpdateBackupStatus(snapshot.Name, config.Volume.Name, string(types.ProgressStateError), 0, "", err.Error())
}
}()

Expand Down

0 comments on commit f079ca3

Please sign in to comment.