Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic on NullTime.UnmarshalJSON #73

Open
wants to merge 1 commit into
base: v1
Choose a base branch
from
Open

Conversation

khoden
Copy link

@khoden khoden commented Aug 3, 2017

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!
}
```
Copy link

@C-Pro C-Pro left a comment

Choose a reason for hiding this comment

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

Seems legit

@JelteF
Copy link

JelteF commented Aug 15, 2017

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

@khoden
Copy link
Author

khoden commented Aug 25, 2017

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