File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,9 @@ func transformFilterRuleProperty(property *filterRuleProperty) *hookdeck.FilterR
111111 // parse string to JSON
112112 var jsonData map [string ]any
113113 jsonBytes := []byte (property .JSON .ValueString ())
114- json .Unmarshal (jsonBytes , & jsonData )
114+ if err := json .Unmarshal (jsonBytes , & jsonData ); err != nil {
115+ return nil
116+ }
115117 return hookdeck .NewFilterRulePropertyFromStringUnknownMapOptional (jsonData )
116118 }
117119 if ! property .Number .IsUnknown () && ! property .Number .IsNull () {
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ func (m *destinationResourceModel) ToCreatePayload() *hookdeck.DestinationCreate
6363 } else {
6464 httpMethod = nil
6565 }
66- var pathForwardingDisabled * hookdeckcore.Optional [bool ] = nil
66+ var pathForwardingDisabled * hookdeckcore.Optional [bool ]
6767 if ! m .PathForwardingDisabled .IsUnknown () && ! m .PathForwardingDisabled .IsNull () {
6868 pathForwardingDisabled = hookdeck .Optional (m .PathForwardingDisabled .ValueBool ())
6969 } else {
@@ -224,7 +224,7 @@ func (m *destinationResourceModel) refreshAuthMethod(destination *hookdeck.Desti
224224 if destination .AuthMethod .CustomSignature != nil {
225225 m .AuthMethod .CustomSignature = & customSignature {}
226226 m .AuthMethod .CustomSignature .Key = types .StringValue (destination .AuthMethod .CustomSignature .Config .Key )
227- m .AuthMethod .CustomSignature .SigningSecret = types .StringValue (string ( * destination .AuthMethod .CustomSignature .Config .SigningSecret ) )
227+ m .AuthMethod .CustomSignature .SigningSecret = types .StringValue (* destination .AuthMethod .CustomSignature .Config .SigningSecret )
228228 }
229229
230230 if destination .AuthMethod .HookdeckSignature != nil {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ func (m *sourceVerificationResourceModel) ToCreatePayload() *hookdeck.SourceUpda
1212}
1313
1414func (m * sourceVerificationResourceModel ) ToUpdatePayload () * hookdeck.SourceUpdateRequest {
15- var verification * hookdeck.VerificationConfig = nil
15+ var verification * hookdeck.VerificationConfig
1616
1717 // generic
1818 if m .Verification .APIKey != nil {
Original file line number Diff line number Diff line change @@ -51,7 +51,9 @@ func (m *transformationResourceModel) getENV() map[string]string {
5151 var envData map [string ]string = nil
5252 if ! m .ENV .IsUnknown () && ! m .ENV .IsNull () {
5353 envBytes := []byte (m .ENV .ValueString ())
54- json .Unmarshal (envBytes , & envData )
54+ if err := json .Unmarshal (envBytes , & envData ); err != nil {
55+ return nil
56+ }
5557 }
5658 return envData
5759}
You can’t perform that action at this time.
0 commit comments