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() ]; //////