Playlist: More defensive proramming for when trying to play an empty playlist.

This commit is contained in:
2019-11-29 05:52:00 +01:00
parent 001e275131
commit dd9e1538c8
3 changed files with 12 additions and 4 deletions

View File

@@ -535,7 +535,10 @@ bool Player::play() {
if (_current_playlist == NULL) return false;
if (_current_playlist->get_file_count()==0) return false;
_current_playlist->start();
String file = _current_playlist->get_current_file();
String file;
if (!_current_playlist->get_current_file(&file)) {
return false;
}
uint32_t position = _current_playlist->get_position();
_state = playing;
_play_file(file, position);