Skip to content

Commit

Permalink
Fix browser model issue identified by model test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 2, 2016
1 parent d4ea95e commit c6c8277
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/qgsbrowsermodel.cpp
Expand Up @@ -337,6 +337,10 @@ void QgsBrowserModel::reload()

QModelIndex QgsBrowserModel::index( int row, int column, const QModelIndex &parent ) const
{
if ( column < 0 || column >= columnCount( parent ) ||
row < 0 || row >= rowCount( parent ) )
return QModelIndex();

QgsDataItem *p = dataItem( parent );
const QVector<QgsDataItem*> &items = p ? p->children() : mRootItems;
QgsDataItem *item = items.value( row, nullptr );
Expand Down

0 comments on commit c6c8277

Please sign in to comment.