Added logic to catch empty playlist edgecase

This commit is contained in:
rainbow napkin 2026-10-06 01:56:24 -04:00
parent 95ae15815b
commit 34e662c1da

View file

@ -860,6 +860,12 @@ class playlistHandler{
return; return;
} }
//If we found an empy playlist
if(foundPlaylist.media.length <= 0){
//ignore it!
return;
}
//Pick a random video ID based on the playlist's length //Pick a random video ID based on the playlist's length
const foundID = Math.round(Math.random() * (foundPlaylist.media.length - 1)); const foundID = Math.round(Math.random() * (foundPlaylist.media.length - 1));