From 05c4826355a19165f5bc4e9599372698964b0513 Mon Sep 17 00:00:00 2001 From: Weston McNamee Date: Mon, 21 Mar 2022 18:06:47 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=20resolve=20getPolicyDoc?= =?UTF-8?q?umentOutput=20nil=20dereference?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolves #1872 --- sdk/go/aws/iam/getPolicyDocument.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/go/aws/iam/getPolicyDocument.go b/sdk/go/aws/iam/getPolicyDocument.go index 985ae766864..84e9525f1c2 100644 --- a/sdk/go/aws/iam/getPolicyDocument.go +++ b/sdk/go/aws/iam/getPolicyDocument.go @@ -138,6 +138,12 @@ func GetPolicyDocumentOutput(ctx *pulumi.Context, args GetPolicyDocumentOutputAr ApplyT(func(v interface{}) (GetPolicyDocumentResult, error) { args := v.(GetPolicyDocumentArgs) r, err := GetPolicyDocument(ctx, &args, opts...) + if err != nil { + return nil, err + } + if r == nil { + return nil, fmt.Errorf("expected either result or error to be nil, not both") + } return *r, err }).(GetPolicyDocumentResultOutput) }