fix null discord notify path
All checks were successful
Build and push image for doorman-homeassistant / docker (push) Successful in 25s
Build and push Doorman UI / API / docker (push) Successful in 1m21s
Build and push image for doorman-homeassistant / deploy-gitainer (push) Successful in 23s

This commit is contained in:
Martin Dimitrov 2024-11-11 20:09:14 -08:00
parent 321ace5b4a
commit 3f7233698a
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
function jsonMsgSuffix(jsonString) {
if (jsonString === undefined) {
if (!jsonString) {
return "";
}
try {
@ -23,7 +23,9 @@ exports.handler = async function(context, event, callback) {
try {
users = JSON.parse(users);
msgs = JSON.parse(msgs);
console.log("before parsing", jsons);
jsons = JSON.parse(jsons);
console.log("after parsing", jsons);
promises = msgs.map((msg, i) =>
discord.sendMessageToUser(

View File

@ -93,7 +93,7 @@ exports.handler = async function(context, event, callback) {
msg + u + ')'
);
await notifyDiscord(context, msgs, config.discordUsers, []);
await notifyDiscord(context, msgs, config.discordUsers, config.discordUsers.map(() => undefined));
let discordLock = false;
let intervals = [];