diff options
Diffstat (limited to 'examples/phonon')
-rw-r--r-- | examples/phonon/musicplayer/mainwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/phonon/musicplayer/mainwindow.cpp b/examples/phonon/musicplayer/mainwindow.cpp index ee97c7a..f123d29 100644 --- a/examples/phonon/musicplayer/mainwindow.cpp +++ b/examples/phonon/musicplayer/mainwindow.cpp @@ -157,9 +157,12 @@ void MainWindow::tableClicked(int row, int /* column */) mediaObject->stop(); mediaObject->clearQueue(); + if (row >= sources.size()) + return; + mediaObject->setCurrentSource(sources[row]); - if (wasPlaying) + if (wasPlaying) mediaObject->play(); else mediaObject->stop(); |