]> cat aescling's git repositories - mastodon.git/commitdiff
Fix crashes from favico.js crashing the entire web app
authorThibaut Girka <thib@sitedethib.com>
Wed, 28 Aug 2019 18:55:23 +0000 (20:55 +0200)
committerThibG <thib@sitedethib.com>
Thu, 29 Aug 2019 10:03:05 +0000 (12:03 +0200)
app/javascript/flavours/glitch/features/ui/index.js

index be1a5343a2d956ff76e835d40818cc1faceea8c3..dbfaf1220d4070930a1e90824ca52a2ee6f0f388 100644 (file)
@@ -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);
+        }
       }
     }
   }