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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 8417004: OmniboxView: Attempt to fix a crash in GetSelectedText(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index 806cd51e3d1e9bffe39848c063d83bac3d50d247..2c9c8d20b0cccbdfa2e9a600230d30f339a2ef8c 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -2109,6 +2109,8 @@ string16 OmniboxViewWin::GetSelectedText() const {
// Figure out the length of the selection.
CHARRANGE sel;
GetSel(sel);
+ if (sel.cpMin == sel.cpMax)
+ return string16();
Peter Kasting 2011/10/27 18:17:53 Nit: Might want to add an EOL comment: "// GetSelT
James Hawkins 2011/10/27 18:26:42 Done.
// Grab the selected text.
string16 str;
« 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