Prevent potential crashes when pressing left/right on playlists

This commit is contained in:
twinaphex 2017-02-24 06:58:22 +01:00
parent 26474ee99e
commit 3ae52e2095
2 changed files with 2 additions and 2 deletions

View File

@ -352,7 +352,7 @@ static int playlist_association_left(unsigned type, const char *label,
info = core_info_get(list, next); info = core_info_get(list, next);
found = string_list_find_elem(stnames, path); found = string_list_find_elem(stnames, path);
if (found) if (found && info)
string_list_set(stcores, found-1, info->path); string_list_set(stcores, found-1, info->path);
string_list_join_concat(new_playlist_cores, string_list_join_concat(new_playlist_cores,

View File

@ -353,7 +353,7 @@ static int playlist_association_right(unsigned type, const char *label,
info = core_info_get(list, next); info = core_info_get(list, next);
found = string_list_find_elem(stnames, path); found = string_list_find_elem(stnames, path);
if (found) if (found && info)
string_list_set(stcores, found-1, info->path); string_list_set(stcores, found-1, info->path);
string_list_join_concat(new_playlist_cores, sizeof(new_playlist_cores), stcores, ";"); string_list_join_concat(new_playlist_cores, sizeof(new_playlist_cores), stcores, ";");