aboutsummaryrefslogtreecommitdiffstats
path: root/screen_play.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-03-31 14:22:55 +0000
committerKalle Wallin <kaw@linux.se>2004-03-31 14:22:55 +0000
commitfbd98e8deb69cd2dc11479efccf3798152010a47 (patch)
treef35d39c543491e17c2cf53707e427358ede161d0 /screen_play.c
parent97e594b4adea4b9b7605eafddf3bf920c86d4192 (diff)
downloadmpd-fbd98e8deb69cd2dc11479efccf3798152010a47.tar.gz
mpd-fbd98e8deb69cd2dc11479efccf3798152010a47.tar.xz
mpd-fbd98e8deb69cd2dc11479efccf3798152010a47.zip
Only delete a song if it exits.
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@557 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--screen_play.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/screen_play.c b/screen_play.c
index 72c223ed3..151402def 100644
--- a/screen_play.c
+++ b/screen_play.c
@@ -130,11 +130,14 @@ play_cmd(screen_t *screen, mpd_client_t *c, command_t cmd)
{
case CMD_DELETE:
song = mpc_playlist_get_song(c, screen->playlist->selected);
- file_clear_highlight(c, song);
- mpd_sendDeleteCommand(c->connection, screen->playlist->selected);
- mpd_finishCommand(c->connection);
- screen_status_printf("Removed \'%s\' from playlist!",
- mpc_get_song_name(song));
+ if( song )
+ {
+ file_clear_highlight(c, song);
+ mpd_sendDeleteCommand(c->connection, screen->playlist->selected);
+ mpd_finishCommand(c->connection);
+ screen_status_printf("Removed \'%s\' from playlist!",
+ mpc_get_song_name(song));
+ }
return 1;
case CMD_SAVE_PLAYLIST:
handle_save_playlist(screen, c);