From 9cf665e832e1ad67dcee625f78c78743e60aecbe Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Thu, 10 Jan 2013 11:43:42 -0500 Subject: guard against NPEs in bitmap decoding. Somehow people occasionally see null bitmaps with valid BitmapFactory.Options. Bug: 7403211 Change-Id: If6e18aa6b1c9ea6b8344f039d26197fbb44ff0d9 --- src/com/android/dreams/phototable/PhotoTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/android/dreams') diff --git a/src/com/android/dreams/phototable/PhotoTable.java b/src/com/android/dreams/phototable/PhotoTable.java index 36b274c..b0d7a01 100644 --- a/src/com/android/dreams/phototable/PhotoTable.java +++ b/src/com/android/dreams/phototable/PhotoTable.java @@ -260,7 +260,7 @@ public class PhotoTable extends FrameLayout { table.mLongSide, table.mShortSide); int photoWidth = mOptions.outWidth; int photoHeight = mOptions.outHeight; - if (mOptions.outWidth <= 0 || mOptions.outHeight <= 0) { + if (decodedPhoto == null || mOptions.outWidth <= 0 || mOptions.outHeight <= 0) { photo = null; } else { decodedPhoto.setHasMipMap(true); -- cgit v1.2.3