Skip to content

Commit

Permalink
Fix Null pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
nperrier committed Nov 6, 2012
1 parent e9547ae commit eaba4c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/com/pugh/sockso/android/data/CoverArtFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected Bitmap doInBackground(String... params) {
*/
@Override
protected void onPostExecute(Bitmap bitmap) {

if (isCancelled()) {
bitmap = null;
}
Expand All @@ -83,7 +84,7 @@ protected void onPostExecute(Bitmap bitmap) {
ImageView imageView = imageViewReference.get();
BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);

if ( width > 0 && height > 0 ) {
if ( bitmap != null && width > 0 && height > 0 ) {
// resize bitmap
bitmap = Bitmap.createScaledBitmap(bitmap, width, height, false);
}
Expand Down

0 comments on commit eaba4c2

Please sign in to comment.