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

Unified Diff: ui/base/dragdrop/os_exchange_data_provider_aurax11.cc

Issue 22901023: linux_aura: Fix crash when dragging NTP icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exclude files on chromeos Created 7 years, 4 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 | « build/filename_rules.gypi ('k') | ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
index 52aa7c6dce2eda003b2049ed721304a70682eea5..55841c7333d1b671f1a43bff4a1dfdacd8d89878 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
+++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
@@ -196,13 +196,14 @@ bool OSExchangeDataProviderAuraX11::GetURLAndTitle(
std::vector<base::string16> tokens;
size_t num_tokens = Tokenize(unparsed, ASCIIToUTF16("\n"), &tokens);
- if (num_tokens >= 2) {
+ if (num_tokens > 0) {
+ if (num_tokens > 1)
+ *title = tokens[1];
+ else
+ *title = string16();
+
*url = GURL(tokens[0]);
- *title = tokens[1];
return true;
- } else {
- NOTREACHED() << "Data that claimed to be a Mozilla URL has "
- << num_tokens << " tokens instead of 2.";
}
} else if (data.GetType() == atom_cache_.GetAtom(
Clipboard::kMimeTypeURIList)) {
« no previous file with comments | « build/filename_rules.gypi ('k') | ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698