Index: ui/app_list/views/apps_grid_view.cc |
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc |
index 5df27a63e79c8a455c62956c478f65b4ea82a8da..140ae4a2a75db94cdf2dfe839d2077e7150321aa 100644 |
--- a/ui/app_list/views/apps_grid_view.cc |
+++ b/ui/app_list/views/apps_grid_view.cc |
@@ -1737,8 +1737,14 @@ void AppsGridView::MoveItemToFolder(AppListItemView* item_view, |
const std::string& source_item_id = item_view->item()->id(); |
AppListItemView* target_view = |
GetViewDisplayedAtSlotOnCurrentPage(target.slot); |
+ DCHECK(target_view); |
const std::string& target_view_item_id = target_view->item()->id(); |
+ // Check that the item is not being dropped onto itself; this should not |
+ // happen, but it can if something allows multiple views to share an |
+ // item (e.g., if a folder drop does not clean up properly). |
+ DCHECK_NE(source_item_id, target_view_item_id); |
+ |
// Make change to data model. |
item_list_->RemoveObserver(this); |
std::string folder_item_id = |