File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
WordPress/src/main/java/org/wordpress/android/ui/media Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2121import org .wordpress .android .R ;
2222import org .wordpress .android .WordPress ;
2323import org .wordpress .android .WordPressDB ;
24- import org .wordpress .android .models .Blog ;
2524import org .wordpress .android .models .MediaFile ;
2625import org .wordpress .android .util .AppLog ;
2726import org .wordpress .android .util .AppLog .T ;
@@ -131,7 +130,9 @@ protected Bitmap doInBackground(Uri... params) {
131130 if (bitmap == null ) {
132131 URL url = new URL (uri );
133132 bitmap = BitmapFactory .decodeStream (url .openConnection ().getInputStream ());
134- WordPress .getBitmapCache ().put (uri , bitmap );
133+ if (bitmap != null ) {
134+ WordPress .getBitmapCache ().put (uri , bitmap );
135+ }
135136 }
136137
137138 return bitmap ;
@@ -145,7 +146,7 @@ protected Bitmap doInBackground(Uri... params) {
145146 protected void onPostExecute (Bitmap result ) {
146147 ImageView imageView = mReference .get ();
147148
148- if (imageView != null ) {
149+ if (imageView != null && result != null ) {
149150 if (imageView .getTag () == this ) {
150151 imageView .setImageBitmap (result );
151152 fadeInImage (imageView , result );
You can’t perform that action at this time.
0 commit comments