summaryrefslogtreecommitdiff
path: root/chromium/components/google/core/browser/google_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/google/core/browser/google_util.cc')
-rw-r--r--chromium/components/google/core/browser/google_util.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/chromium/components/google/core/browser/google_util.cc b/chromium/components/google/core/browser/google_util.cc
index 2820e033dbf..5d712f7b521 100644
--- a/chromium/components/google/core/browser/google_util.cc
+++ b/chromium/components/google/core/browser/google_util.cc
@@ -175,7 +175,8 @@ std::string GetGoogleCountryCode(const GURL& google_homepage_url) {
// TODO(igorcov): This needs a fix for case when the host has a trailing dot,
// like "google.com./". https://crbug.com/720295.
const size_t last_dot = google_hostname.find_last_of('.');
- DCHECK_NE(std::string::npos, last_dot);
+ if (last_dot == std::string::npos)
+ return std::string();
base::StringPiece country_code = google_hostname.substr(last_dot + 1);
// Assume the com TLD implies the US.
if (country_code == "com")