Null checks are good

This commit is contained in:
Christopher Eby 2010-05-22 17:28:09 -05:00
parent 2fb8ec71f0
commit c7f33c2f61

View File

@ -114,6 +114,9 @@ public final class CoverBitmap {
return null;
Bitmap cover = song.getCover();
if (cover == null)
return null;
int coverWidth = cover.getWidth();
int coverHeight = cover.getHeight();
float scale = coverWidth > coverHeight ? (float)size / coverWidth : (float)size / coverHeight;