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

Unified Diff: ui/app_list/views/apps_grid_view.cc

Issue 271753007: Fix crash in ReparentItemToAnotherFolder() on Windows app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment Created 6 years, 7 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5a620a6270152c26c6b3aaf8ed0ec9a953d12074..e30092b639fd06ffbd76d2fcc116f991b9e253b5 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -1671,6 +1671,11 @@ void AppsGridView::ReparentItemToAnotherFolder(views::View* item_view,
const Index& target) {
DCHECK(IsDraggingForReparentInRootLevelGridView());
+ AppListItemView* target_view =
+ static_cast<AppListItemView*>(GetViewAtSlotOnCurrentPage(target.slot));
+ if (!target_view)
+ return;
+
// Make change to data model.
item_list_->RemoveObserver(this);
@@ -1686,8 +1691,6 @@ void AppsGridView::ReparentItemToAnotherFolder(views::View* item_view,
if (source_folder->ChildItemCount() == 1u)
DeleteItemViewAtIndex(view_model_.GetIndexOfView(activated_item_view()));
- AppListItemView* target_view =
- static_cast<AppListItemView*>(GetViewAtSlotOnCurrentPage(target.slot));
AppListItem* target_item = target_view->item();
// Move item to the target folder.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698