summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authornkostylev@google.com <nkostylev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 10:46:53 +0000
committernkostylev@google.com <nkostylev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 10:46:53 +0000
commit8741cfecae9a11360850b01e998cfbf9cc443f92 (patch)
treeebcba12a9559c34c68245c78b9a9cadbca31efce /chrome/browser
parent57d37ae3f7b4b3d020a7bf164e8be321f2babf1e (diff)
downloadchromium_src-8741cfecae9a11360850b01e998cfbf9cc443f92.zip
chromium_src-8741cfecae9a11360850b01e998cfbf9cc443f92.tar.gz
chromium_src-8741cfecae9a11360850b01e998cfbf9cc443f92.tar.bz2
Do nothing when "No selection" entry is selected.
That entry is at index=0. BUG=cros:3361 TEST=Select secure network and cancel dialog. Select first entry at network combobox. It should not crash. Review URL: http://codereview.chromium.org/2074020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47908 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/login/network_screen.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/login/network_screen.cc b/chrome/browser/chromeos/login/network_screen.cc
index 6a4e9ed..a17d4d8 100644
--- a/chrome/browser/chromeos/login/network_screen.cc
+++ b/chrome/browser/chromeos/login/network_screen.cc
@@ -57,7 +57,8 @@ std::wstring NetworkScreen::GetItemAt(int index) {
void NetworkScreen::ItemChanged(views::Combobox* sender,
int prev_index,
int new_index) {
- if (new_index == prev_index || new_index < 0 || prev_index < 0)
+ // Corner case: item with index 0 is "No selection". Just select it.
+ if (new_index == prev_index || new_index <= 0 || prev_index < 0)
return;
if (networks_.IsEmpty())