From 29363680e8adf441e5debbc112c1104725023da4 Mon Sep 17 00:00:00 2001
From: Elias Nahum <nahumhbl@gmail.com>
Date: Fri, 25 Mar 2016 23:48:22 -0300
Subject: Fix default Browser locale

---
 webapp/action_creators/global_actions.jsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'webapp/action_creators/global_actions.jsx')

diff --git a/webapp/action_creators/global_actions.jsx b/webapp/action_creators/global_actions.jsx
index 196d2b32c..7322f1150 100644
--- a/webapp/action_creators/global_actions.jsx
+++ b/webapp/action_creators/global_actions.jsx
@@ -265,7 +265,8 @@ export function newLocalizationSelected(locale) {
 }
 
 export function loadBrowserLocale() {
-    let locale = (navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage)).split('-')[0];
+    let locale = (navigator.languages && navigator.languages.length > 0 ? navigator.languages[0] :
+        (navigator.language || navigator.userLanguage)).split('-')[0];
     if (!I18n.getLanguages()[locale]) {
         locale = 'en';
     }
-- 
cgit v1.2.3-1-g7c22

