Skip to content
Permalink
Browse files

Fix unreported crash when clicking edit button in vector tile

renderer/labeling settings and no row is selected
  • Loading branch information
nyalldawson committed Sep 7, 2020
1 parent 8976fda commit 1de92549173b1030a5b78011dd74cdd02cba976d
@@ -348,6 +348,9 @@ void QgsVectorTileBasicLabelingWidget::editStyle()

void QgsVectorTileBasicLabelingWidget::editStyleAtIndex( const QModelIndex &index )
{
if ( index.row() < 0 || index.row() >= mLabeling->styles().count() )
return;

QgsVectorTileBasicLabelingStyle style = mLabeling->style( index.row() );

QgsPalLayerSettings labelSettings = style.labelSettings();
@@ -385,6 +388,9 @@ void QgsVectorTileBasicLabelingWidget::editStyleAtIndex( const QModelIndex &inde
void QgsVectorTileBasicLabelingWidget::updateLabelingFromWidget()
{
int index = viewStyles->selectionModel()->currentIndex().row();
if ( index < 0 )
return;

QgsVectorTileBasicLabelingStyle style = mLabeling->style( index );

QgsLabelingPanelWidget *widget = qobject_cast<QgsLabelingPanelWidget *>( sender() );
@@ -361,6 +361,9 @@ void QgsVectorTileBasicRendererWidget::editStyle()

void QgsVectorTileBasicRendererWidget::editStyleAtIndex( const QModelIndex &index )
{
if ( index.row() < 0 || index.row() >= mRenderer->styles().count() )
return;

QgsVectorTileBasicRendererStyle style = mRenderer->style( index.row() );

if ( !style.symbol() )
@@ -402,6 +405,9 @@ void QgsVectorTileBasicRendererWidget::editStyleAtIndex( const QModelIndex &inde
void QgsVectorTileBasicRendererWidget::updateSymbolsFromWidget()
{
int index = viewStyles->selectionModel()->currentIndex().row();
if ( index < 0 )
return;

QgsVectorTileBasicRendererStyle style = mRenderer->style( index );

QgsSymbolSelectorWidget *dlg = qobject_cast<QgsSymbolSelectorWidget *>( sender() );

0 comments on commit 1de9254

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