From 4eae285160f21317d71101394de387007aef99fc Mon Sep 17 00:00:00 2001 From: Hugh Wang Date: Sun, 5 Mar 2017 22:21:06 +0800 Subject: [PATCH] Fix crash when jumping to playing song in playlist editor By default, PlaylistEditor delays fetching of the content for performance reasons. If the user switches the playlist then tells ncmpcpp to jump to the currently playing song within the delay, the update request that fetches the new content will be ignored. This results in inconsistent content, or crash if the position of the song in the new content exceeds the length of the stale content. This fix enforces a fetch even if the update request that fetches the new content stays within the delay. --- src/screens/playlist_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screens/playlist_editor.cpp b/src/screens/playlist_editor.cpp index 402c0359..b8e4168d 100644 --- a/src/screens/playlist_editor.cpp +++ b/src/screens/playlist_editor.cpp @@ -485,7 +485,7 @@ void PlaylistEditor::locatePlaylist(const MPD::Playlist &playlist) void PlaylistEditor::gotoSong(size_t playlist_index, size_t song_index) { Playlists.highlight(playlist_index); - Content.clear(); + requestContentsUpdate(); update(); Content.highlight(song_index);