Skip to content

Commit

Permalink
Fix crash with "add selected layers" from browser (fix #14223)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 4, 2016
1 parent 2566061 commit 0796df0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsbrowserdockwidget.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -577,9 +577,9 @@ void QgsBrowserDockWidget::addSelectedLayers()
qSort( list ); qSort( list );


// If any of the layer items are QGIS we just open and exit the loop // If any of the layer items are QGIS we just open and exit the loop
for ( int i = 0; i <= list.size(); i++ ) Q_FOREACH ( const QModelIndex& index, list )
{ {
QgsDataItem *item = mModel->dataItem( mProxyModel->mapToSource( list[i] ) ); QgsDataItem *item = mModel->dataItem( mProxyModel->mapToSource( index ) );
if ( item && item->type() == QgsDataItem::Project ) if ( item && item->type() == QgsDataItem::Project )
{ {
QgsProjectItem *projectItem = qobject_cast<QgsProjectItem*>( item ); QgsProjectItem *projectItem = qobject_cast<QgsProjectItem*>( item );
Expand Down

0 comments on commit 0796df0

Please sign in to comment.