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

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

Issue 2551243002: Use ChromeLauncherControllerImpl::GetItem; cleanup. (Closed)
Patch Set: Add early return to ShelfModel::Set. 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..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);
« 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