From 96d98a6dcca83ee14c560676fc21b2e9816b4b72 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 28 Feb 2020 09:23:02 +0100 Subject: [PATCH] Added workerId validation --- back/methods/chat/sendCheckingPresence.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/back/methods/chat/sendCheckingPresence.js b/back/methods/chat/sendCheckingPresence.js index f67fb6942..6fa029b70 100644 --- a/back/methods/chat/sendCheckingPresence.js +++ b/back/methods/chat/sendCheckingPresence.js @@ -24,6 +24,8 @@ module.exports = Self => { }); Self.sendCheckingPresence = async(ctx, workerId, message) => { + if (!workerId) return false; + const models = Self.app.models; const account = await models.Account.findById(workerId); const userId = ctx.req.accessToken.userId;