OSDN Git Service

Quick patch for b/12446428.
authorDan Sandler <dsandler@android.com>
Fri, 10 Jan 2014 18:24:55 +0000 (13:24 -0500)
committerDan Sandler <dsandler@android.com>
Fri, 10 Jan 2014 18:24:55 +0000 (13:24 -0500)
Bug: 12446428
Change-Id: I5b9472e55a8919f5640c6e97fede9b5637819be0

src/com/android/launcher3/Folder.java

index 758ee5b..a9a161a 100644 (file)
@@ -1107,7 +1107,10 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
                 if (getItemCount() <= 1) {
                     // Remove the folder
                     LauncherModel.deleteItemFromDatabase(mLauncher, mInfo);
-                    cellLayout.removeView(mFolderIcon);
+                    if (cellLayout != null) {
+                        // b/12446428 -- sometimes the cell layout has already gone away?
+                        cellLayout.removeView(mFolderIcon);
+                    }
                     if (mFolderIcon instanceof DropTarget) {
                         mDragController.removeDropTarget((DropTarget) mFolderIcon);
                     }