Skip to content
Permalink
Browse files

Fix unreported crash when clicking edit button in vector tile rendere…

…r/labeling settings and no row is selected
  • Loading branch information
github-actions authored and nyalldawson committed Sep 7, 2020
1 parent 93b4d20 commit 016e1870405fc2840d07c230f908c2f2de928b7d
@@ -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 016e187

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