Skip to content

Commit

Permalink
Merge pull request #538 from jonathon-love/master
Browse files Browse the repository at this point in the history
Fix to generation of verify methods for bytes
  • Loading branch information
dcodeIO authored Dec 11, 2016
2 parents 178525c + 3e9d8ea commit 97a8485
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function verify(message) {

// required or present fields
} else if (field.required || value !== undefined) {

if (reason = verifyValue(field, value)) // eslint-disable-line no-cond-assign
return reason;
}
Expand Down Expand Up @@ -172,7 +172,7 @@ function genVerifyValue(gen, field, fieldIndex, ref) {
("return%j", invalid(field, "string"));
break;
case "bytes": gen
("if(!(%s&&typeof %s.length==='number'||util.isString(%s))", ref, ref, ref)
("if(!(%s&&typeof %s.length==='number'||util.isString(%s)))", ref, ref, ref)
("return%j", invalid(field, "buffer"));
break;
default:
Expand Down

0 comments on commit 97a8485

Please sign in to comment.