Remove wrong (re)initialization of cached_external, add NULL check

This commit is contained in:
Bernhard Schelling 2020-07-31 01:26:58 +09:00
parent 5da2ada6b8
commit fc5a11d2e7
1 changed files with 5 additions and 3 deletions

View File

@ -111,8 +111,11 @@ typedef int (playlist_sort_fun_t)(
void playlist_set_cached_external(playlist_t* pl) void playlist_set_cached_external(playlist_t* pl)
{ {
playlist_free_cached(); playlist_free_cached();
playlist_cached = pl; if (pl)
playlist_cached->cached_external = true; {
playlist_cached = pl;
playlist_cached->cached_external = true;
}
} }
/* Convenience function: copies specified playlist /* Convenience function: copies specified playlist
@ -1392,7 +1395,6 @@ void playlist_write_runtime_file(playlist_t *playlist)
playlist->modified = false; playlist->modified = false;
playlist->old_format = false; playlist->old_format = false;
playlist->compressed = false; playlist->compressed = false;
playlist->cached_external = false;
RARCH_LOG("[Playlist]: Written to playlist file: %s\n", playlist->config.path); RARCH_LOG("[Playlist]: Written to playlist file: %s\n", playlist->config.path);
end: end: