Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Unified Diff: ui/base/l10n/l10n_util.cc

Issue 14230008: Fix CHECK failure in l10n_util::IsLocaleAvailable(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/l10n/l10n_util.cc
diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc
index 86b29802dbda5328321337f145d49d6deb44e8fb..67cca7f45d0f33f957677f0ecf445cd44f45747f 100644
--- a/ui/base/l10n/l10n_util.cc
+++ b/ui/base/l10n/l10n_util.cc
@@ -246,6 +246,11 @@ 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;
jungshik at Google 2013/04/16 20:04:55 With this, in https://codereview.chromium.org/1382
hshi1 2013/04/16 20:36:39 It seems very difficult to make LocaleDataPakExist
+
return ResourceBundle::GetSharedInstance().LocaleDataPakExists(locale);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698