Skip to content

Commit a5c0e7e

Browse files
committed
[composer] Check if attribute index is valid when reading attribute table fields from pre 2.4 projects (refs #10482)
1 parent d38ba92 commit a5c0e7e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/composer/qgscomposerattributetable.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ void QgsComposerAttributeTable::setDisplayAttributes( const QSet<int>& attr, boo
274274
for ( ; attIt != attr.constEnd(); ++attIt )
275275
{
276276
int attrIdx = ( *attIt );
277+
if ( !fields.exists( attrIdx ) )
278+
{
279+
continue;
280+
}
277281
QString currentAlias = mVectorLayer->attributeDisplayName( attrIdx );
278282
QgsComposerTableColumn* col = new QgsComposerTableColumn;
279283
col->setAttribute( fields[attrIdx].name() );

0 commit comments

Comments
 (0)