Chromium Code Reviews| 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 8d7db8e3059e040100923b4074cba36feee749ed..71911dbc2ca2905216fe8c023bc88cc9967064ce 100644 |
| --- a/ui/app_list/views/apps_grid_view.cc |
| +++ b/ui/app_list/views/apps_grid_view.cc |
| @@ -1733,7 +1733,13 @@ void AppsGridView::MoveItemToFolder(AppListItemView* item_view, |
| const Index& target) { |
| const std::string& source_item_id = item_view->item()->id(); |
| AppListItemView* target_view = GetViewAtSlotOnCurrentPage(target.slot); |
| - const std::string& target_view_item_id = target_view->item()->id(); |
| + 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. |
|
calamity
2014/09/26 03:55:18
(e.g a folder drop does not clean up properly)
Matt Giuca
2014/09/29 03:05:03
Done.
|
| + DCHECK_NE(source_item_id, target_view_item_id); |
| // Make change to data model. |
| item_list_->RemoveObserver(this); |