From c84cee5fece9d53bfad6f5273e71d71bf70e506a Mon Sep 17 00:00:00 2001 From: blacktwin Date: Tue, 17 Aug 2021 08:00:45 -0400 Subject: [PATCH] include check for whether or not the title template returns anything in the case of returning nothing, script would delete every playlist Resolves #303 --- fun/playlist_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fun/playlist_manager.py b/fun/playlist_manager.py index 7665ab2..b90571c 100644 --- a/fun/playlist_manager.py +++ b/fun/playlist_manager.py @@ -628,7 +628,7 @@ def delete_playlist(playlist_dict, title, jbop=None): # catching for history* jbops titleTemplate = selectors().get(jbop) titleStart = titleTemplate.split('{')[0] - if playlist.title.startswith(titleStart): + if titleStart and playlist.title.startswith(titleStart): playlist.delete() logger.info("...Deleted Playlist: {playlist.title} for '{user}'." .format(playlist=playlist, user=user))