File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -132,11 +132,12 @@ void QgsAtlasCompositionWidget::onLayerAdded( QgsMapLayer* map )
132
132
if ( vectorLayer )
133
133
{
134
134
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
+ }
140
141
}
141
142
}
142
143
@@ -186,8 +187,11 @@ void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChang
186
187
{
187
188
QgsVectorLayer* layer = reinterpret_cast <QgsVectorLayer*>( mAtlasCoverageLayerComboBox ->itemData ( index ).value <void *>() );
188
189
189
- checkLayerType ( layer );
190
- atlasMap->setCoverageLayer ( layer );
190
+ if ( layer )
191
+ {
192
+ checkLayerType ( layer );
193
+ atlasMap->setCoverageLayer ( layer );
194
+ }
191
195
192
196
// update sorting columns
193
197
fillSortColumns ();
@@ -197,6 +201,7 @@ void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChang
197
201
void QgsAtlasCompositionWidget::checkLayerType ( QgsVectorLayer *layer )
198
202
{
199
203
// enable or disable fixed scale control based on layer type
204
+ if ( !layer ) return ;
200
205
switch ( layer->wkbType () )
201
206
{
202
207
case QGis::WKBPoint:
You can’t perform that action at this time.
0 commit comments