Index: chrome/browser/custom_home_pages_table_model.cc |
diff --git a/chrome/browser/custom_home_pages_table_model.cc b/chrome/browser/custom_home_pages_table_model.cc |
index 24607174635a0eab19ed825f5d08dfc3e82986d2..05f86cfeb705354e25704c0464531aa61e3427c6 100644 |
--- a/chrome/browser/custom_home_pages_table_model.cc |
+++ b/chrome/browser/custom_home_pages_table_model.cc |
@@ -96,9 +96,14 @@ void CustomHomePagesTableModel::SetURLs(const std::vector<GURL>& urls) { |
*/ |
void CustomHomePagesTableModel::MoveURLs(int insert_before, |
const std::vector<int>& index_list) { |
- DCHECK(!index_list.empty()); |
DCHECK(insert_before >= 0 && insert_before <= RowCount()); |
+ // This is a bug. This should be a DCHECK, but under circumstances, the JS can |
+ // get confused and pass us an empty list of selected indices to drag move. |
Dan Beam
2013/10/14 18:08:07
Are you sure it's the WebUI's fault? This can only
|
+ // See http://crbug.com/302284. |
+ if (index_list.empty()) |
Dan Beam
2013/10/14 18:08:07
NOTREACHED();
|
+ return; |
+ |
// The range of elements that needs to be reshuffled is [ |first|, |last| ). |
int first = std::min(insert_before, index_list.front()); |
int last = std::max(insert_before, index_list.back() + 1); |