RocksonZeta / koa-validate

validate koa request params and format request params
https://github.com/RocksonZeta/koa-validate
MIT License
284 stars 32 forks source link

Fixed unwanted exception being thrown on body. #2

Closed technicallyjosh closed 9 years ago

technicallyjosh commented 9 years ago

When no body is passed, the validation should still be fired. Previous line of code assumed that some sort of body was being passed. Error was TypeError: Cannot read property 'fields' of null. This would hit on the first checkBody() call. With this fix, when no body is passed, the validation returns as intended.

coveralls commented 9 years ago

Coverage Status

Coverage remained the same when pulling 57d1b4eb713bf8ec8af430859dff321a715c8d21 on technicallyjosh:master into 4b990d35d8d511aa9d835c8110a7f906c0fe1cd0 on RocksonZeta:master.

danneu commented 9 years ago

+1

JiangJie commented 9 years ago

+1

kulbida commented 9 years ago

+1

technicallyjosh commented 9 years ago

This was resolved and my PR was just sitting around.