am 2ce4c348: am 0c5b5883: am 1325f557: Stop crashing on invalid wallpaper thumbnail images.
Merge commit '2ce4c3487389e3887c6ec085069422ad69cd570c'
* commit '2ce4c3487389e3887c6ec085069422ad69cd570c':
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;
}
}