Skip to content

Commit f9a0a1d

Browse files
committedJun 4, 2013
fixed rashes in atlas calling vector methods for rasters, fixes #7963
1 parent 383e7f1 commit f9a0a1d

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed
 

‎src/app/composer/qgsatlascompositionwidget.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,12 @@ void QgsAtlasCompositionWidget::onLayerAdded( QgsMapLayer* map )
132132
if ( vectorLayer )
133133
{
134134
mAtlasCoverageLayerComboBox->addItem( map->name(), qVariantFromValue(( void* )map ) );
135-
}
136-
if ( mAtlasCoverageLayerComboBox->count() == 1 )
137-
{
138-
atlasMap->setCoverageLayer( vectorLayer );
139-
checkLayerType( vectorLayer );
135+
136+
if ( mAtlasCoverageLayerComboBox->count() == 1 )
137+
{
138+
atlasMap->setCoverageLayer( vectorLayer );
139+
checkLayerType( vectorLayer );
140+
}
140141
}
141142
}
142143

@@ -186,8 +187,11 @@ void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChang
186187
{
187188
QgsVectorLayer* layer = reinterpret_cast<QgsVectorLayer*>( mAtlasCoverageLayerComboBox->itemData( index ).value<void*>() );
188189

189-
checkLayerType( layer );
190-
atlasMap->setCoverageLayer( layer );
190+
if ( layer )
191+
{
192+
checkLayerType( layer );
193+
atlasMap->setCoverageLayer( layer );
194+
}
191195

192196
// update sorting columns
193197
fillSortColumns();
@@ -197,6 +201,7 @@ void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChang
197201
void QgsAtlasCompositionWidget::checkLayerType( QgsVectorLayer *layer )
198202
{
199203
// enable or disable fixed scale control based on layer type
204+
if ( !layer ) return;
200205
switch ( layer->wkbType() )
201206
{
202207
case QGis::WKBPoint:

0 commit comments

Comments
 (0)
Please sign in to comment.