about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-08-28 20:55:23 +0200
committerThibG <thib@sitedethib.com>2019-08-29 12:03:05 +0200
commit79725f659d5e9c449df0ff73f9363407a0a064bd (patch)
treeb56219abede355b30a156921ed8edd71b7e416f2
parent956c1cf82a4fa018311ad985336c46c05e799ee4 (diff)
Fix crashes from favico.js crashing the entire web app
-rw-r--r--app/javascript/flavours/glitch/features/ui/index.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js
index be1a5343a..dbfaf1220 100644
--- a/app/javascript/flavours/glitch/features/ui/index.js
+++ b/app/javascript/flavours/glitch/features/ui/index.js
@@ -366,7 +366,11 @@ class UI extends React.Component {
     if (this.props.unreadNotifications != prevProps.unreadNotifications ||
         this.props.showFaviconBadge != prevProps.showFaviconBadge) {
       if (this.favicon) {
-        this.favicon.badge(this.props.showFaviconBadge ? this.props.unreadNotifications : 0);
+        try {
+          this.favicon.badge(this.props.showFaviconBadge ? this.props.unreadNotifications : 0);
+        } catch (err) {
+          console.error(err);
+        }
       }
     }
   }