OSDN Git Service

Fix a NPE found by Moneky.
authorOwen Lin <owenlin@google.com>
Thu, 17 May 2012 20:04:35 +0000 (13:04 -0700)
committerThe Android Automerger <android-build@android.com>
Fri, 18 May 2012 21:54:14 +0000 (14:54 -0700)
AlbumLabelMaker.mBitmapPool could be null if the setLabelWidth()
has never been called  or called with width as 0.

bug:6510386

Change-Id: Idaaa0a1a7239271ba3ae3217e65029b382464c10

src/com/android/gallery3d/ui/AlbumLabelMaker.java

index f837092..93b37ce 100644 (file)
@@ -211,6 +211,6 @@ public class AlbumLabelMaker {
     }
 
     public void clearRecycledLabels() {
-        mBitmapPool.clear();
+        if (mBitmapPool != null) mBitmapPool.clear();
     }
 }