commit 8ba91b250e0c36e6da3a4e9e1aa26b12dabf0de0 branch master Author: Rick W. Chen Date: Wed Dec 1 10:12:55 2010 +1300 Fix cover dialog crash when pressing Ok when nothing is selected BUG:258187 diff --git a/ChangeLog b/ChangeLog index 97e9661..581f47f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -74,6 +74,7 @@ VERSION 2.4-Beta 1 pressing SHIFT while clicking the action will bypass trash. BUGFIXES: + * Fixed cover dialog crash pressing Ok when nothing is selected. (BR 258187) * Title labels incorrectly used the text color from the plasma theme. This caused trouble with the fixed plasma theme and light color schemes. * Fixed a data-loss bug where the user could lose changes he made to the current diff --git a/src/covermanager/CoverFoundDialog.cpp b/src/covermanager/CoverFoundDialog.cpp index 36f83cb..e92946e 100644 --- a/src/covermanager/CoverFoundDialog.cpp +++ b/src/covermanager/CoverFoundDialog.cpp @@ -423,7 +423,12 @@ void CoverFoundDialog::slotButtonClicked( int button ) { if( button == KDialog::Ok ) { - CoverFoundItem *item = static_cast< CoverFoundItem* >( m_view->currentItem() ); + CoverFoundItem *item = dynamic_cast< CoverFoundItem* >( m_view->currentItem() ); + if( !item ) + { + reject(); + return; + } bool gotBigPix( true ); if( !item->hasBigPix() )