Skip to content
Permalink
Browse files

Fix crash due to index on wrong model

  • Loading branch information
elpaso committed Nov 1, 2018
1 parent 0cd21c9 commit 0cf8a33dab44fca9800ec81ea652f6e6da9de0d5
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/app/qgslayertreeviewbadlayerindicator.cpp
@@ -83,7 +83,7 @@ void QgsLayerTreeViewBadLayerIndicatorProvider::onIndicatorClicked( const QModel
{
if ( index.isValid() )
{
const QgsLayerItem *item = qobject_cast<QgsLayerItem *>( browserModel.dataItem( index ) );
const QgsLayerItem *item = qobject_cast<QgsLayerItem *>( proxyModel.dataItem( index ) );
if ( item && item->mapLayerType() == layerType )
{
return true;
@@ -103,7 +103,7 @@ void QgsLayerTreeViewBadLayerIndicatorProvider::onIndicatorClicked( const QModel
QModelIndex idx = browserWidget->currentIndex();
if ( isItemCompatible( idx ) )
{
const QgsDataItem *item( browserModel.dataItem( idx ) );
const QgsDataItem *item( proxyModel.dataItem( idx ) );
layer->setDataSource( item->mimeUri().uri, layer->name(), item->mimeUri().providerKey, QgsDataProvider::ProviderOptions() );
// Re-apply style
if ( ! layer->originalXmlProperties().isEmpty() )

0 comments on commit 0cf8a33

Please sign in to comment.
You can’t perform that action at this time.