Commit 3aa47134 authored by Kevin Whitaker's avatar Kevin Whitaker

Don't read from playlist if nothing there.

parent 845068db
......@@ -107,7 +107,11 @@ QList<QString> MiniMediaPlayer::getTrackNames()
QMap<QString, qint64> MiniMediaPlayer::currentState()
{
QMap<QString,qint64> state;
state.insert("duration",playlist.first().trackLength);
if(playlist.size() < 1) {
state.insert("duration",0);
} else {
state.insert("duration",playlist.first().trackLength);
}
state.insert("position",m_player->position());
state.insert("state",isPlaying());
return state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment