Fixed possible NPE in media browser.
This commit is contained in:
parent
89de580223
commit
2926d3af2f
1 changed files with 5 additions and 4 deletions
|
@ -76,11 +76,12 @@ public class FileArrayAdapter extends ArrayAdapter<DIDLObject> {
|
||||||
TextView title = (TextView) convertView.findViewById(R.id.title);
|
TextView title = (TextView) convertView.findViewById(R.id.title);
|
||||||
TextView artist = (TextView) convertView.findViewById(R.id.subtitle);
|
TextView artist = (TextView) convertView.findViewById(R.id.subtitle);
|
||||||
RemoteImageView image = (RemoteImageView) convertView.findViewById(R.id.image);
|
RemoteImageView image = (RemoteImageView) convertView.findViewById(R.id.image);
|
||||||
MusicTrack track;
|
|
||||||
if (item instanceof MusicTrack) {
|
if (item instanceof MusicTrack) {
|
||||||
track = (MusicTrack) item;
|
MusicTrack track = (MusicTrack) item;
|
||||||
title.setText(Integer.toString(track.getOriginalTrackNumber()) +
|
String trackNumber = (track.getOriginalTrackNumber() != null)
|
||||||
". " + item.getTitle());
|
? Integer.toString(track.getOriginalTrackNumber()) + ". "
|
||||||
|
: "";
|
||||||
|
title.setText(trackNumber + item.getTitle());
|
||||||
artist.setText(track.getArtists()[0].getName());
|
artist.setText(track.getArtists()[0].getName());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Reference in a new issue