Skip to content

Commit fdc2594

Browse files
committed
make parse_menu_playlists more error proof
1 parent bd51238 commit fdc2594

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ytmusicapi/parsers/_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55

66
def parse_menu_playlists(data, result):
7-
watch_menu = find_objects_by_key(nav(data, MENU_ITEMS), MNIR)
7+
menu_items = nav(data, MENU_ITEMS, True)
8+
if menu_items is None:
9+
return
10+
watch_menu = find_objects_by_key(menu_items, MNIR)
811
for item in [_x[MNIR] for _x in watch_menu]:
912
icon = nav(item, ICON_TYPE)
1013
if icon == "MUSIC_SHUFFLE":

0 commit comments

Comments
 (0)