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

json: Don't panic for nil Encode{Time, Duration} #835

Merged
merged 1 commit into from
Jun 10, 2020

Commits on Jun 4, 2020

  1. json: Don't panic for nil Encode{Time, Duration}

    Fixes #834
    
    The JSON encoder assumes that encoders for `time.Time` and
    `time.Duration` are always specified, which causes nil pointer
    dereference panics.
    
    Fix this by treating nil encoders for time and duration as no-ops. This
    will fall back to existing logic in the JSON encoder that handles no-op
    time and duration encoders.
    abhinav committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    c6cdc02 View commit details
    Browse the repository at this point in the history