🐛 fixing Cannot read property 'name' of null

This commit is contained in:
Ricardo Paes
2022-02-24 08:43:56 -03:00
parent e7252c1273
commit a837e555a0

View File

@@ -10,7 +10,9 @@ const GetDefaultWhatsAppByUser = async (
return null;
}
logger.info(`Found whatsapp linked to user '${user.name}' is '${user.whatsapp.name}'.`);
if(user.whatsapp !== null) {
logger.info(`Found whatsapp linked to user '${user.name}' is '${user.whatsapp.name}'.`);
}
return user.whatsapp;
};