From 25e6998a79334d8f5029e7e9621516896f2a0b8a Mon Sep 17 00:00:00 2001 From: aj Date: Thu, 10 Oct 2019 11:58:37 +0100 Subject: [PATCH] added uri type checking --- spotframework/engine/playlistengine.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spotframework/engine/playlistengine.py b/spotframework/engine/playlistengine.py index fb6ddf4..8aa03db 100644 --- a/spotframework/engine/playlistengine.py +++ b/spotframework/engine/playlistengine.py @@ -127,6 +127,10 @@ class PlaylistEngine: if name: playlist = next((i for i in playlist_source.playlists if i.name == name), None) else: + + if uri.object_type is not Uri.ObjectType.playlist: + raise TypeError('uri not a playlist') + playlist = next((i for i in playlist_source.playlists if i.uri == uri), None) if playlist is None: