Don't try to parse non-strings
This commit is contained in:
parent
c7d66377d0
commit
41edd0567d
@ -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 @@
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return utils.detectLocale(isSupportedByLibrary) || 'en';
|
return utils.detectLocale(isSupportedByLibrary) || 'en';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user