Skip to content

Commit

Permalink
Fix: issue #24
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevsaddam committed Feb 21, 2018
1 parent d1b2d42 commit 53a5c55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -9,6 +9,7 @@ matrix:
- go: 1.7
- go: 1.8
- go: 1.9
- go: 1.10
- go: tip
allow_failures:
- go: tip
Expand Down
4 changes: 2 additions & 2 deletions validator.go
Expand Up @@ -92,8 +92,8 @@ func (v *Validator) Validate() url.Values {
// validate file
if strings.HasPrefix(field, "file:") {
fld := strings.TrimPrefix(field, "file:")
file, _, _ := v.Opts.Request.FormFile(fld)
if file != nil {
file, fh, _ := v.Opts.Request.FormFile(fld)
if file != nil && fh.Filename != "" {
validateFiles(v.Opts.Request, fld, rule, msg, errsBag)
validateCustomRules(fld, rule, msg, file, errsBag)
} else {
Expand Down

0 comments on commit 53a5c55

Please sign in to comment.