More typechecking

This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-04 22:57:27 +01:00
parent ad8bd1bff4
commit 924cc44a20
8 changed files with 42 additions and 22 deletions

View File

@@ -1,6 +1,11 @@
function password(inp, coll, guid, offline, socket) {
if(inp !== undefined && inp !== null && inp !== "")
{
if(!inp.hasOwnProperty("password") || !inp.hasOwnProperty("channel") ||
typeof(inp.password) != "string" || typeof(inp.channel) != "string") {
socket.emit("update_required");
return;
}
pw = inp.password;
opw = inp.password;
try {