From e53e1b057237d1a23c397e28f0f423708f04beb4 Mon Sep 17 00:00:00 2001 From: Stano Bocinec Date: Fri, 11 Oct 2024 17:22:36 +0200 Subject: [PATCH] Fix nil pointer deref panic on helm_release destroy The destroy panics when helm returns "release not found" as the returned response is nil. --- .changelog/1501.txt | 3 +++ helm/resource_release.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/1501.txt diff --git a/.changelog/1501.txt b/.changelog/1501.txt new file mode 100644 index 000000000..5456846a7 --- /dev/null +++ b/.changelog/1501.txt @@ -0,0 +1,3 @@ +```release-note:bug +`helm_release`: Fix nil pointer deref panic on destroy when helm release is not found +``` diff --git a/helm/resource_release.go b/helm/resource_release.go index 4548df965..1cd41468d 100644 --- a/helm/resource_release.go +++ b/helm/resource_release.go @@ -869,7 +869,7 @@ func resourceReleaseDelete(ctx context.Context, d *schema.ResourceData, meta int return diag.FromErr(err) } - if res.Info != "" { + if res != nil && res.Info != "" { return diag.Diagnostics{ { Severity: diag.Warning,