Fixed a NPE.
This commit is contained in:
parent
10120c0148
commit
47190c55e3
1 changed files with 7 additions and 1 deletions
|
|
@ -272,7 +272,13 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
updateIsFavoriteTask = new AsyncTask<Song, Void, Boolean>() {
|
updateIsFavoriteTask = new AsyncTask<Song, Void, Boolean>() {
|
||||||
@Override
|
@Override
|
||||||
protected Boolean doInBackground(Song... params) {
|
protected Boolean doInBackground(Song... params) {
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity != null) {
|
||||||
return MusicUtil.isFavorite(getActivity(), params[0]);
|
return MusicUtil.isFavorite(getActivity(), params[0]);
|
||||||
|
} else {
|
||||||
|
cancel(false);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue