From 2c45e525aa96f41ac624198e658d932d6b96f441 Mon Sep 17 00:00:00 2001 From: Shahaf Bahar Date: Thu, 14 Dec 2023 16:22:45 +0200 Subject: [PATCH] Fix panic when csi timeout duration is short https://github.com/vmware-tanzu/velero-plugin-for-csi/pull/215 Signed-off-by: Shahaf Bahar --- internal/util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/util/util.go b/internal/util/util.go index e2fb11cd..ea27d582 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -193,7 +193,7 @@ func GetVolumeSnapshotContentForVolumeSnapshot(volSnap *snapshotv1api.VolumeSnap if err != nil { if err == wait.ErrWaitTimeout { - if snapshotContent.Status != nil && snapshotContent.Status.Error != nil { + if snapshotContent != nil && snapshotContent.Status != nil && snapshotContent.Status.Error != nil { log.Errorf("Timed out awaiting reconciliation of volumesnapshot, Volumesnapshotcontent %s has error: %v", snapshotContent.Name, snapshotContent.Status.Error.Message) } else { log.Errorf("Timed out awaiting reconciliation of volumesnapshot %s/%s", volSnap.Namespace, volSnap.Name)