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..e5254194943251de107a35898f92308d4c35c6c1 100644 |
--- a/ash/common/shelf/shelf_model.cc |
+++ b/ash/common/shelf/shelf_model.cc |
@@ -90,7 +90,11 @@ 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()) { |
+ NOTREACHED(); |
+ return; |
+ } |
+ |
int new_index = item.type == items_[index].type |
? index |
: ValidateInsertionIndex(item.type, index); |