From 8360c112fb26d4dc2394653333051b293abbfebb Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 27 Jan 2016 15:19:25 +0000 Subject: [PATCH] Put the favicon badge call in a try block, as per comment --- src/components/structures/MatrixChat.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 80489085ed..3184380005 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -773,7 +773,14 @@ module.exports = React.createClass({ notifCount += rooms[i].getUnreadNotificationCount(); } } - this.favicon.badge(notifCount); + try { + // This needs to be in in a try block as it will throw + // if there are more than 100 badge count changes in + // its internal queue + this.favicon.badge(notifCount); + } catch (e) { + console.warn("Failed to set badge count: "+e.message); + } document.title = (notifCount > 0 ? "["+notifCount+"] " : "")+"Vector"; },