diff --git a/website/server/libs/pushNotifications.js b/website/server/libs/pushNotifications.js index a38162bf00..267685b840 100644 --- a/website/server/libs/pushNotifications.js +++ b/website/server/libs/pushNotifications.js @@ -28,6 +28,11 @@ function removePushDevice (user, pushDevice) { export const MAX_MESSAGE_LENGTH = 300; async function sendFCMNotification (user, pushDevice, payload) { + if (nconf.get('FIREBASE_PROJECT_ID') === undefined || nconf.get('FIREBASE_PROJECT_ID') === '') { + logger.info('Will not send push notification, because Firebase is not configured.'); + return; + } + const messaging = admin.messaging(); if (messaging === undefined) { return; diff --git a/website/server/libs/slack.js b/website/server/libs/slack.js index 13fabe0665..38327edce6 100644 --- a/website/server/libs/slack.js +++ b/website/server/libs/slack.js @@ -20,7 +20,7 @@ let flagSlack; let subscriptionSlack; try { - if (IS_TEST || IS_PRODUCTION) { + if ((IS_TEST || IS_PRODUCTION) && SLACK_FLAGGING_URL && SLACK_SUBSCRIPTIONS_URL) { flagSlack = new IncomingWebhook(SLACK_FLAGGING_URL); subscriptionSlack = new IncomingWebhook(SLACK_SUBSCRIPTIONS_URL); } else {