mirror of
https://github.com/ysoftdevs/terraform-provider-bitbucketserver.git
synced 2026-01-11 22:41:45 +01:00
fix: Allow unmarshal json to tolerate null datetimes (#27)
Signed-off-by: James Dobson <jdobson@guidewire.com>
This commit is contained in:
@@ -15,6 +15,11 @@ func (t jsonTime) MarshalJSON() ([]byte, error) {
|
||||
func (t *jsonTime) UnmarshalJSON(s []byte) (err error) {
|
||||
r := strings.Replace(string(s), `"`, ``, -1)
|
||||
|
||||
if r == "null" {
|
||||
*(*time.Time)(t) = time.Time{}
|
||||
return
|
||||
}
|
||||
|
||||
q, err := strconv.ParseInt(r, 10, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user