Chromium Code Reviews| Index: ash/common/shelf/shelf_model.cc |
| diff --git a/ash/common/shelf/shelf_model.cc b/ash/common/shelf/shelf_model.cc |
| index 04705e42bba10079bad171eca6d54d0ad960a08c..273d5ac9c815ebe1d95878c00b744b19e69be939 100644 |
| --- a/ash/common/shelf/shelf_model.cc |
| +++ b/ash/common/shelf/shelf_model.cc |
| @@ -91,6 +91,9 @@ void ShelfModel::Move(int index, int target_index) { |
| void ShelfModel::Set(int index, const ShelfItem& item) { |
| DCHECK(index >= 0 && index < item_count()); |
| + if (index < 0 || index >= item_count()) |
|
James Cook
2016/12/06 05:54:22
Yeah, this is all that I meant.
optional: You cou
msw
2016/12/06 18:02:22
Done.
|
| + return; |
| + |
| int new_index = item.type == items_[index].type |
| ? index |
| : ValidateInsertionIndex(item.type, index); |