From 2a107615258d3c3208e0edd15a6ae6bf715d9de2 Mon Sep 17 00:00:00 2001 From: Michael Herger Date: Wed, 27 Apr 2022 16:24:17 +0200 Subject: [PATCH] Don't try to get `isPlaylist()` here, as we'd only get here if `$playlistObj` wasn't a playlist. --- Slim/Control/Commands.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Slim/Control/Commands.pm b/Slim/Control/Commands.pm index 83ba37a8e94..a6b673be1d4 100644 --- a/Slim/Control/Commands.pm +++ b/Slim/Control/Commands.pm @@ -2344,13 +2344,10 @@ sub playlistsDeleteCommand { sub _wipePlaylist { - my $playlistObj = shift; - if ( ! ( blessed($playlistObj) && $playlistObj->isPlaylist() ) ) { - $log->error('PlaylistObj not right for this sub: ', $playlistObj); - $log->error('PlaylistObj not right for this sub: ', $playlistObj->isPlaylist() ); + Slim::Utils::Log::logBacktrace('PlaylistObj not right for this sub: ' . $playlistObj); return 0; } @@ -3240,8 +3237,10 @@ sub _playlistXitem_load_done { if ($wipePlaylist) { my $playlistObj = Slim::Schema->objectForUrl($url); - _wipePlaylist($playlistObj); + if ($playlistObj && blessed($playlistObj) && $playlistObj->isPlaylist()) { + _wipePlaylist($playlistObj); + } } Slim::Control::Request::notifyFromArray($client, ['playlist', 'load_done']);