From 5623827433b18ad9cc6e1ea82b7b41fa48550ea6 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 4 May 2015 11:08:52 +1000 Subject: [PATCH] careful checking for a global that is not there --- .../discourse/lib/desktop-notifications.js.es6 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/desktop-notifications.js.es6 b/app/assets/javascripts/discourse/lib/desktop-notifications.js.es6 index 894ac2c7e..dc20601f4 100644 --- a/app/assets/javascripts/discourse/lib/desktop-notifications.js.es6 +++ b/app/assets/javascripts/discourse/lib/desktop-notifications.js.es6 @@ -28,8 +28,15 @@ function init(messageBus) { return; } - if (!Notification) { - Em.Logger.info('Discourse desktop notifications are disabled - not supported by browser'); + + + try { + if (!Notification) { + Em.Logger.info('Discourse desktop notifications are disabled - not supported by browser'); + return; + } + } catch (e) { + Em.Logger.info('Discourse desktop notifications are disabled - not defined'); return; }