Skip to content
Permalink
Browse files

QgsRendererV2PropertiesDialog::syncToLayer(): make it robust to NULL …

…renderer

Fixes #15064

Probably just a band-aid, proper fix to follow in OGR provider itself.
  • Loading branch information
rouault committed Jun 18, 2016
1 parent f354998 commit aceef9ed477b9b3df0b8f2cac405d56bd368a4c1
Showing with 11 additions and 7 deletions.
  1. +11 −7 src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp
@@ -331,7 +331,8 @@ void QgsRendererV2PropertiesDialog::syncToLayer()

// setup slot rendererChanged()
//setup order by
if ( mLayer->rendererV2()->orderByEnabled() )
if ( mLayer->rendererV2() &&
mLayer->rendererV2()->orderByEnabled() )
{
checkboxEnableOrderBy->setChecked( true );
}
@@ -343,14 +344,17 @@ void QgsRendererV2PropertiesDialog::syncToLayer()
}
lineEditOrderBy->setReadOnly( true );

// set current renderer from layer
QString rendererName = mLayer->rendererV2()->type();
if ( mLayer->rendererV2() )
{
// set current renderer from layer
QString rendererName = mLayer->rendererV2()->type();

int rendererIdx = cboRenderers->findData( rendererName );
cboRenderers->setCurrentIndex( rendererIdx );
int rendererIdx = cboRenderers->findData( rendererName );
cboRenderers->setCurrentIndex( rendererIdx );

// no renderer found... this mustn't happen
Q_ASSERT( rendererIdx != -1 && "there must be a renderer!" );
// no renderer found... this mustn't happen
Q_ASSERT( rendererIdx != -1 && "there must be a renderer!" );
}

}

0 comments on commit aceef9e

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