Merge "Throw IOE from within resolveImage rather than NPE." into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
36060929b4
@@ -124,6 +124,9 @@ public class NotificationInlineImageResolver implements ImageResolver {
|
|||||||
*/
|
*/
|
||||||
Drawable resolveImage(Uri uri) throws IOException {
|
Drawable resolveImage(Uri uri) throws IOException {
|
||||||
BitmapDrawable image = resolveImageInternal(uri);
|
BitmapDrawable image = resolveImageInternal(uri);
|
||||||
|
if (image == null || image.getBitmap() == null) {
|
||||||
|
throw new IOException("resolveImageInternal returned null for uri: " + uri);
|
||||||
|
}
|
||||||
Bitmap bitmap = image.getBitmap();
|
Bitmap bitmap = image.getBitmap();
|
||||||
image.setBitmap(Icon.scaleDownIfNecessary(bitmap, mMaxImageWidth, mMaxImageHeight));
|
image.setBitmap(Icon.scaleDownIfNecessary(bitmap, mMaxImageWidth, mMaxImageHeight));
|
||||||
return image;
|
return image;
|
||||||
|
|||||||
Reference in New Issue
Block a user