Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b65a90d7 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I73b00501 into eclair-mr2

* changes:
  Check cursor and URI value for nullity to prevent NPE.
parents c642199d 73b00501
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -459,6 +459,7 @@ public class ThumbnailUtil {
        Cursor c = cr.query(thumbUri, THUMB_PROJECTION,
              Thumbnails.IMAGE_ID + "=?",
              new String[]{String.valueOf(origId)}, null);
        if (c == null) return null;
        try {
            if (c.moveToNext()) {
                return ContentUris.withAppendedId(thumbUri, c.getLong(0));
@@ -487,6 +488,7 @@ public class ThumbnailUtil {
        if (thumb == null) return false;
        try {
            Uri uri = getImageThumbnailUri(cr, origId, thumb.getWidth(), thumb.getHeight());
            if (uri == null) return false;
            OutputStream thumbOut = cr.openOutputStream(uri);
            thumb.compress(Bitmap.CompressFormat.JPEG, 85, thumbOut);
            thumbOut.close();