diff --git a/internal/util/util.go b/internal/util/util.go index 94c68cf7..d8058516 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -266,8 +266,9 @@ func GetVolumeSnapshotContentForVolumeSnapshot(volSnap *snapshotv1api.VolumeSnap if err != nil { if err == wait.ErrWaitTimeout { - if 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) + 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) + err = fmt.Errorf("CSI got timed out with error: %v", *snapshotContent.Status.Error.Message) } else { log.Errorf("Timed out awaiting reconciliation of volumesnapshot %s/%s", volSnap.Namespace, volSnap.Name) }