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..ad7858345fc8062008cb28189e6a763495fe4dda 100644 |
--- a/ui/app_list/views/apps_grid_view.cc |
+++ b/ui/app_list/views/apps_grid_view.cc |
@@ -1680,14 +1680,17 @@ void AppsGridView::ReparentItemToAnotherFolder(views::View* item_view, |
AppListFolderItem* source_folder = |
static_cast<AppListFolderItem*>(item_list_->FindItem(source_folder_id)); |
+ AppListItemView* target_view = |
+ static_cast<AppListItemView*>(GetViewAtSlotOnCurrentPage(target.slot)); |
+ if (!target_view) |
+ return; |
tapted
2014/05/09 02:55:47
I think this will ~leak the observer removed up on
calamity
2014/05/09 03:13:02
Done.
|
+ |
// Remove the source folder view if there is only 1 item in it, since the |
// source folder will be deleted after its only child item merged into the |
// target item. |
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. |