From 7d60ab6e9c8b739976e9b739e8cac94c72c70764 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 30 Jan 2009 21:52:08 +0100 Subject: [PATCH] check if playlist/playlist editor is empty before an attempt to move a song --- src/ncmpcpp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 516711b0..b695572f 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -2251,7 +2251,7 @@ int main(int argc, char *argv[]) } else if (Keypressed(input, Key.MvSongUp)) { - if (current_screen == csPlaylist) + if (current_screen == csPlaylist && !mPlaylist->Empty()) { block_playlist_update = 1; mPlaylist->SetTimeout(50); @@ -2304,7 +2304,7 @@ int main(int argc, char *argv[]) } mPlaylist->SetTimeout(ncmpcpp_window_timeout); } - else if (wCurrent == mPlaylistEditor) + else if (wCurrent == mPlaylistEditor && !mPlaylistEditor->Empty()) { mPlaylistEditor->SetTimeout(50); if (mPlaylistEditor->hasSelected()) @@ -2354,7 +2354,7 @@ int main(int argc, char *argv[]) } else if (Keypressed(input, Key.MvSongDown)) { - if (current_screen == csPlaylist) + if (current_screen == csPlaylist && !mPlaylist->Empty()) { block_playlist_update = 1; mPlaylist->SetTimeout(50); @@ -2408,7 +2408,7 @@ int main(int argc, char *argv[]) mPlaylist->SetTimeout(ncmpcpp_window_timeout); } - else if (wCurrent == mPlaylistEditor) + else if (wCurrent == mPlaylistEditor && !mPlaylistEditor->Empty()) { mPlaylistEditor->SetTimeout(50); if (mPlaylistEditor->hasSelected())