diff --git a/recipes/instagram-direct-messages/package.json b/recipes/instagram-direct-messages/package.json index 41aa129f4..ab94fae76 100644 --- a/recipes/instagram-direct-messages/package.json +++ b/recipes/instagram-direct-messages/package.json @@ -1,7 +1,7 @@ { "id": "instagram-direct-messages", "name": "Instagram Direct Messages", - "version": "1.1.1", + "version": "1.1.2", "license": "MIT", "config": { "serviceURL": "https://www.instagram.com/direct/inbox/", diff --git a/recipes/instagram-direct-messages/webview.js b/recipes/instagram-direct-messages/webview.js index e3cc241d9..d297ac50a 100644 --- a/recipes/instagram-direct-messages/webview.js +++ b/recipes/instagram-direct-messages/webview.js @@ -14,7 +14,7 @@ module.exports = Ferdium => { const getMessages = () => { const element = document.querySelector('a[href^="/direct/inbox"] span'); Ferdium.setBadge( - element.textContent ? Ferdium.safeParseInt(element.textContent) : 0, + element && element.textContent ? Ferdium.safeParseInt(element.textContent) : 0, ); }; diff --git a/recipes/instagram/package.json b/recipes/instagram/package.json index e0449bb7c..742516424 100644 --- a/recipes/instagram/package.json +++ b/recipes/instagram/package.json @@ -1,7 +1,7 @@ { "id": "instagram", "name": "Instagram", - "version": "2.5.2", + "version": "2.5.3", "license": "MIT", "config": { "serviceURL": "https://instagram.com/", diff --git a/recipes/instagram/webview.js b/recipes/instagram/webview.js index dcf9d5b1d..290aea62b 100644 --- a/recipes/instagram/webview.js +++ b/recipes/instagram/webview.js @@ -41,11 +41,10 @@ module.exports = (Ferdium, settings) => { const getMessages = () => { const element = document.querySelector('a[href^="/direct/inbox"] span'); - if (element) { - Ferdium.setBadge( - element.textContent ? Ferdium.safeParseInt(element.textContent) : 0, - ); - } + Ferdium.setBadge( + element && element.textContent ? Ferdium.safeParseInt(element.textContent) : 0, + ); + }; Ferdium.loop(getMessages);