check return value of getSong(0)

This commit is contained in:
Adrian Ulrich 2015-01-01 08:53:18 +01:00
parent 0832a0175d
commit 84f153d49a

View File

@ -402,6 +402,8 @@ public class FullPlaybackActivity extends PlaybackActivity
final PlaybackService playbackService = PlaybackService.get(this);
final Song sng = playbackService.getSong(0);
final PlaybackActivity activity = this;
if (sng != null) {
String delete_message = getString(R.string.delete_item, sng.title);
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle(R.string.delete);
@ -420,6 +422,7 @@ public class FullPlaybackActivity extends PlaybackActivity
}
});
dialog.create().show();
}
break;
case MENU_SHOW_QUEUE:
startActivity(new Intent(this, ShowQueueActivity.class));