Merge pull request #291 from xbao/fix/cover-crash

Check width and height > 0 before generating bitmap
This commit is contained in:
Adrian Ulrich 2016-02-20 09:34:47 +01:00
commit a347f38eb7

View File

@ -359,6 +359,12 @@ public final class CoverView extends View implements Handler.Callback {
*/
private void generateBitmap(int i)
{
if(getWidth() == 0 || getHeight() == 0) {
// View isn't laid out - can't generate the bitmap until we know the size
mPendingQuery = true;
return;
}
Song song = mSongs[i];
int style = mCoverStyle;