diff --git a/app/soapbox/service-worker/web-push-notifications.ts b/app/soapbox/service-worker/web-push-notifications.ts index be40aa1832..0cd9370412 100644 --- a/app/soapbox/service-worker/web-push-notifications.ts +++ b/app/soapbox/service-worker/web-push-notifications.ts @@ -134,8 +134,10 @@ const htmlToPlainText = (html: string): string => /** ServiceWorker `push` event callback. */ const handlePush = (event: PushEvent) => { - // If event has no data, stop here. - if (!event.data) return; + if (!event.data) { + console.error('An empty web push event was received.', { event }); + return; + } const { access_token, notification_id, preferred_locale, title, body, icon } = event.data.json();