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>() {
|
||||
@Override
|
||||
protected Boolean doInBackground(Song... params) {
|
||||
return MusicUtil.isFavorite(getActivity(), params[0]);
|
||||
Activity activity = getActivity();
|
||||
if (activity != null) {
|
||||
return MusicUtil.isFavorite(getActivity(), params[0]);
|
||||
} else {
|
||||
cancel(false);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue