Commit f585bac3 authored by Harald Sitter's avatar Harald Sitter 🚔

do not attempt to add/remove nullptr widgets to/from the pagestack

CHANGELOG: Prevent crash with broken video files
BUG: 381282
parent adeb85c6
......@@ -434,7 +434,7 @@ void
MainWindow::toggleLoadView()
{
if( m_mainView->currentWidget() == m_loadView ) {
if( engine()->state() != Phonon::StoppedState ) {
if (m_currentWidget && engine()->state() != Phonon::StoppedState) {
if( m_mainView->indexOf(m_currentWidget) == -1 ) {
m_mainView->addWidget(m_currentWidget);
}
......@@ -443,7 +443,7 @@ MainWindow::toggleLoadView()
engine()->isPreview(false);
} else if( m_currentWidget != m_audioView ) {
m_mainView->setCurrentWidget( m_loadView );
if( engine()->state() != Phonon::StoppedState ) {
if (m_currentWidget && engine()->state() != Phonon::StoppedState) {
m_mainView->removeWidget(m_currentWidget);
engine()->isPreview(true);
m_loadView->setThumbnail(m_currentWidget);
......
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