am 1325f557: Stop crashing on invalid wallpaper thumbnail images.
Merge commit '1325f557bb2646cbaf00ed7d1de42b47cf59b895' into eclair-mr2
* commit '1325f557bb2646cbaf00ed7d1de42b47cf59b895':
Stop crashing on invalid wallpaper thumbnail images.
diff --git a/src/com/android/launcher2/WallpaperChooser.java b/src/com/android/launcher2/WallpaperChooser.java
index a5cce06..a74fa6a 100644
--- a/src/com/android/launcher2/WallpaperChooser.java
+++ b/src/com/android/launcher2/WallpaperChooser.java
@@ -171,9 +171,17 @@
} else {
image = (ImageView) convertView;
}
-
- image.setImageResource(mThumbs.get(position));
- image.getDrawable().setDither(true);
+
+ int thumbRes = mThumbs.get(position);
+ image.setImageResource(thumbRes);
+ Drawable thumbDrawable = image.getDrawable();
+ if (thumbDrawable != null) {
+ thumbDrawable.setDither(true);
+ } else {
+ Log.e(Launcher.LOG_TAG, String.format(
+ "Error decoding thumbnail resId=%d for wallpaper #%d",
+ thumbRes, position));
+ }
return image;
}
}