diff --git a/core/playlists/artist.c b/core/playlists/artist.c index 30a9c239..3b54be59 100644 --- a/core/playlists/artist.c +++ b/core/playlists/artist.c @@ -63,12 +63,13 @@ static bool __artist_pl_load(void *data) for (i = 0; i < n; i++) { name = file_readl(&artist_file); playlist = __artist_pl_lookup(name); + g_free(name); + if (!playlist) continue; queue_load_flags(&playlist->pl_queue, &artist_file, true); queue_iter_set(&playlist->pl_queue, &playlist->pl_queue.q_cur, playlist->pl_queue.q_cur.it_pos); - g_free(name); } file_close(&artist_file); diff --git a/core/playlists/library.c b/core/playlists/library.c index 6a19784d..8a918cf0 100644 --- a/core/playlists/library.c +++ b/core/playlists/library.c @@ -71,12 +71,13 @@ static bool __lib_pl_load(void *data) for (i = 0; i < n; i++) { name = file_readl(&lib_file); playlist = __lib_pl_lookup(name); + g_free(name); + if (!playlist) continue; queue_load_flags(&playlist->pl_queue, &lib_file, true); queue_iter_set(&playlist->pl_queue, &playlist->pl_queue.q_cur, playlist->pl_queue.q_cur.it_pos); - g_free(name); } file_close(&lib_file);