diff --git a/app/util/Format.js b/app/util/Format.js index eef3b5b6..d9136332 100644 --- a/app/util/Format.js +++ b/app/util/Format.js @@ -9,6 +9,6 @@ Ext.define('Rambox.util.Format', { } ,stripNumber: function(n) { - return (typeof n == "number") ? n : parseInt(n.match(/\d+/g).join("")); + return (typeof n == "number") ? n : n.match(/\d+/g) ? parseInt(n.match(/\d+/g).join("")) : 0; } }); diff --git a/electron/main.js b/electron/main.js index 499946da..792f4ffd 100644 --- a/electron/main.js +++ b/electron/main.js @@ -163,7 +163,7 @@ function createWindow () { } function updateBadge(title) { - const messageCount = (/\(([0-9]+)\)/).exec(title); + var messageCount = title.match(/\d+/g) ? parseInt(title.match(/\d+/g).join("")) : 0; if (process.platform === 'win32') { tray.setBadge(messageCount);