Skip to content
Snippets Groups Projects
Commit 1101fb21 authored by JediKev's avatar JediKev
Browse files

i18n: Fix getPrimaryLanguage() on non-object

This addresses issues #1964 & #3668 where $cfg might be null and cause a
non-object error. Check if $cfg is set, if not return the default
en_US language.
parent c0ab9679
No related branches found
No related tags found
No related merge requests found
...@@ -364,7 +364,7 @@ class Internationalization { ...@@ -364,7 +364,7 @@ class Internationalization {
return $lang = self::isLanguageInstalled($best_match_langcode) return $lang = self::isLanguageInstalled($best_match_langcode)
? $best_match_langcode ? $best_match_langcode
: $cfg->getPrimaryLanguage(); : ($cfg ? $cfg->getPrimaryLanguage() : 'en_US');
} }
static function getCurrentLanguage($user=false) { static function getCurrentLanguage($user=false) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment