Commit 41edd056 authored by JC Brand's avatar JC Brand

Don't try to parse non-strings

parent c7d66377
...@@ -457,6 +457,7 @@ ...@@ -457,6 +457,7 @@
} }
utils.getLocale = function (preferred_locale, isSupportedByLibrary) { utils.getLocale = function (preferred_locale, isSupportedByLibrary) {
if (_.isString(preferred_locale)) {
if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) { if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) {
return preferred_locale; return preferred_locale;
} }
...@@ -466,6 +467,7 @@ ...@@ -466,6 +467,7 @@
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
}
return utils.detectLocale(isSupportedByLibrary) || 'en'; return utils.detectLocale(isSupportedByLibrary) || 'en';
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment