Skip to content

Fix panic on NullTime.UnmarshalJSON#73

Open
khoden wants to merge 1 commit into
mgutz:v1from
khoden:patch-1
Open

Fix panic on NullTime.UnmarshalJSON#73
khoden wants to merge 1 commit into
mgutz:v1from
khoden:patch-1

Conversation

@khoden

@khoden khoden commented Aug 3, 2017

Copy link
Copy Markdown
type WithDate struct {
	Time dat.NullTime `json:"time"`
}

func TestParseNumberAsDate(t *testing.T) {
	data := `{"time":5}`
	result := &WithDate{}
	json.Unmarshal([]byte(data), result) // PANIC!
}

```json
type WithDate struct {
	Time dat.NullTime `json:"time"`
}

func TestParseNumberAsDate(t *testing.T) {
	data := `{"time":5}`
	result := &WithDate{}
	json.Unmarshal([]byte(data), result) // PANIC!
}
```

@C-Pro C-Pro left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit

@JelteF

JelteF commented Aug 15, 2017

Copy link
Copy Markdown

This test should probably be added to the actual tests as well.

@khoden

khoden commented Aug 25, 2017

Copy link
Copy Markdown
Author

Please, accept

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants