Commit 10a3d98e authored by Sébastien Toque's avatar Sébastien Toque

Audio: don't crash if title is null

parent 8672b29a
......@@ -131,14 +131,15 @@ public class AudioPlayerActivity extends Activity implements IAudioPlayer {
return;
}
if (!mAudioController.getTitle().equals(lastTitle)) {
String title = mAudioController.getTitle();
if (title != null && !title.equals(lastTitle)) {
Bitmap cover = mAudioController.getCover();
if (cover != null)
mCover.setImageBitmap(cover);
else
mCover.setImageResource(R.drawable.cone);
}
lastTitle = mAudioController.getTitle();
lastTitle = title;
mTitle.setText(lastTitle);
mArtist.setText(mAudioController.getArtist());
mAlbum.setText(mAudioController.getAlbum());
......
......@@ -161,7 +161,8 @@ public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
return;
}
if (!mAudioPlayerControl.getTitle().equals(lastTitle)) {
String title = mAudioPlayerControl.getTitle();
if (title != null && !title.equals(lastTitle)) {
Bitmap cover = mAudioPlayerControl.getCover();
if (cover != null) {
mCover.setVisibility(ImageView.VISIBLE);
......@@ -171,7 +172,7 @@ public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
}
}
lastTitle = mAudioPlayerControl.getTitle();
lastTitle = title;
mTitle.setText(lastTitle);
mArtist.setText(mAudioPlayerControl.getArtist());
if (mAudioPlayerControl.isPlaying()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment