feat: checking for whatsapp session Id on ticket and message creation

This commit is contained in:
canove
2020-09-06 14:22:05 -03:00
parent 371477aa98
commit b793d28e60
7 changed files with 60 additions and 6 deletions

View File

@@ -90,7 +90,8 @@ module.exports = {
const sessionIndex = sessions.findIndex(s => s.id === whatsappId);
if (sessionIndex === -1) {
throw new Error("This Wbot session is not initialized");
console.log("This Wbot session is not initialized");
return null;
}
return sessions[sessionIndex];
},