summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/base/l10n/l10n_util.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc
index 86b29802..0b7b9b7 100644
--- a/ui/base/l10n/l10n_util.cc
+++ b/ui/base/l10n/l10n_util.cc
@@ -246,6 +246,14 @@ bool IsLocaleAvailable(const std::string& locale) {
if (!l10n_util::IsLocaleSupportedByOS(locale))
return false;
+ // If the ResourceBundle is not yet initialized, return false to avoid the
+ // CHECK failure in ResourceBundle::GetSharedInstance().
+ if (!ResourceBundle::HasSharedInstance())
+ return false;
+
+ // TODO(hshi): make ResourceBundle::LocaleDataPakExists() a static function
+ // so that this can be invoked without initializing the global instance.
+ // See crbug.com/230432: CHECK failure in GetUserDataDir().
return ResourceBundle::GetSharedInstance().LocaleDataPakExists(locale);
}