Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > 53cb9583af5db1223b23118d9cbd9335 > files > 21

lastfm-player-1.5.4.27091-3.mga1.src.rpm

Prevent a crash when dragging sidebar items
--- a/src/SideBarModel.cpp
+++ b/src/SideBarModel.cpp
@@ -236,6 +236,8 @@
 Qt::ItemFlags
 SideBarModel::flags( const QModelIndex& index ) const
 {
+    if ( !index.isValid() )
+        return 0;
     SideBarItem i( index, m_masterList );
     Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsDropEnabled;
 
@@ -859,7 +861,7 @@
         }
     }
  
-    if( m_type == TypeUnknown )
+    if( m_type == TypeUnknown && i.isValid() )
         m_type = m_masterList[ i.row() ];
 
 //////