Qt decided to start passing invalid indexes to mapFromSource, do not crash on them

BUGS: 291278
FIXED-IN: 4.8.0
This commit is contained in:
Albert Astals Cid 2012-01-16 21:04:15 +01:00
parent 47c036cfe1
commit 7884c879a7

View file

@ -405,6 +405,9 @@ QModelIndex AuthorGroupProxyModel::parent( const QModelIndex &index ) const
QModelIndex AuthorGroupProxyModel::mapFromSource( const QModelIndex &sourceIndex ) const
{
if ( !sourceIndex.isValid() )
return QModelIndex();
const AuthorGroupItem *item = d->mRoot->findIndex( sourceIndex );
if ( !item )
return QModelIndex();