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

Unified Diff: ash/common/shelf/shelf_model.cc

Issue 2551243002: Use ChromeLauncherControllerImpl::GetItem; cleanup. (Closed)
Patch Set: Address comment. Created 4 years 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 | chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698