belong-inc / go-hubspot

HubSpot API Go client
Apache License 2.0
35 stars 26 forks source link

No value in HubSpot field the call to the value type method will fail #4

Closed kk-no closed 2 years ago

kk-no commented 2 years ago

Version

Describe the bug

If the HubSpot field does not have a value, the struct will be marshalled with nil. But, the HsStr.String is a method of value type, a call with nil will fail and a panic will be occurred. We need to make the receiver a pointer and do a nil check.