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

decoder panics on empty url value #45

Closed
mihaiav opened this issue Nov 17, 2019 · 1 comment · Fixed by #46
Closed

decoder panics on empty url value #45

mihaiav opened this issue Nov 17, 2019 · 1 comment · Fixed by #46
Assignees
Labels

Comments

@mihaiav
Copy link

mihaiav commented Nov 17, 2019

The code below panics with index out of range. It seems a trivial / common use case so I wonder why it wasn't caught earlier.

        type T1 struct {
		F1 string `form:"F1"`
	
	}
	in := url.Values{
		"F1":     []string{}, 
	}

	v := new(T1)
	if err := dec.Decode(v, in); err != nil{
		panic(err)
	}
deankarn added a commit that referenced this issue Nov 17, 2019
Fixed out-of-range exception.

Fixes #45
@deankarn deankarn self-assigned this Nov 17, 2019
@deankarn deankarn added the bug label Nov 17, 2019
@deankarn
Copy link
Contributor

Thanks for reporting @mihaiav will fix ASAP

deankarn added a commit that referenced this issue Nov 17, 2019
Fixed out-of-range exception.

Fixes #45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants