From fc5a11d2e76b336d3090ad2c6eaff49f607b8bbd Mon Sep 17 00:00:00 2001 From: Bernhard Schelling <14200249+schellingb@users.noreply.github.com> Date: Fri, 31 Jul 2020 01:26:58 +0900 Subject: [PATCH] Remove wrong (re)initialization of cached_external, add NULL check --- playlist.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/playlist.c b/playlist.c index 029e0a1d56..bdfd41ef77 100644 --- a/playlist.c +++ b/playlist.c @@ -111,8 +111,11 @@ typedef int (playlist_sort_fun_t)( void playlist_set_cached_external(playlist_t* pl) { playlist_free_cached(); - playlist_cached = pl; - playlist_cached->cached_external = true; + if (pl) + { + playlist_cached = pl; + playlist_cached->cached_external = true; + } } /* Convenience function: copies specified playlist @@ -1392,7 +1395,6 @@ void playlist_write_runtime_file(playlist_t *playlist) playlist->modified = false; playlist->old_format = false; playlist->compressed = false; - playlist->cached_external = false; RARCH_LOG("[Playlist]: Written to playlist file: %s\n", playlist->config.path); end: