From 13e55cd8ec006ab1fa0adbc50bd1ef5294b3a5eb Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Wed, 2 Dec 2015 12:11:55 -0500
Subject: Stop firefox from crashing due to fonts

---
 web/react/utils/utils.jsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'web/react/utils/utils.jsx')

diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 9f80f1bb8..d2dd6cf38 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -696,8 +696,10 @@ export function applyTheme(theme) {
 
 export function applyFont(fontName) {
     const body = document.querySelector('body');
-    body.classList.forEach((className) => {
-        if (className.lastIndexOf('font') === 0) {
+    const keys = Object.getOwnPropertyNames(body.classList);
+    keys.forEach((k) => {
+        const className = body.classList[k];
+        if (className && className.lastIndexOf('font') === 0) {
             body.classList.remove(className);
         }
     });
-- 
cgit v1.2.3-1-g7c22

