X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fshared%2FuserCheck.js;fp=public%2Fjavascripts%2Fshared%2FuserCheck.js;h=65ed1db8a12e848edb04b57dd62b562d3c4dcf93;hp=bd282baf70591dbd46743ab2334a7e5f717b830c;hb=c018b304ba439ca92348dcb65715707f5cfcee05;hpb=8a477a7e1b781babc74d7935b80ac0b18ec04f86 diff --git a/public/javascripts/shared/userCheck.js b/public/javascripts/shared/userCheck.js index bd282baf..65ed1db8 100644 --- a/public/javascripts/shared/userCheck.js +++ b/public/javascripts/shared/userCheck.js @@ -1,13 +1,13 @@ function checkNameEmail(o) { - if (!!o.name) + if (typeof o.name === "string") { if (o.name.length == 0) return "Empty name"; if (!o.name.match(/^[\w]+$/)) return "Bad characters in name"; } - if (!!o.email) + if (typeof o.email === "string") { if (o.email.length == 0) return "Empty email";