Merge pull request #61553 from hongchaodeng/time

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

meta/v1: check error from json.Unmarshal()

Release note:
```
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-03-25 21:34:10 -07:00 committed by GitHub
commit 433c01a7b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,10 @@ func (t *Time) UnmarshalJSON(b []byte) error {
}
var str string
json.Unmarshal(b, &str)
err := json.Unmarshal(b, &str)
if err != nil {
return err
}
pt, err := time.Parse(time.RFC3339, str)
if err != nil {