Skip to content

Commit 1cd7808

Browse files
committedJun 20, 2016
QgsAttributeTableFilterModel::headerData(): fix crash on layer with no field
Fix crash on qgis_attributetabletest and when displaying the attribute table of a layer without any attribute field. Was likely introduced in 4a3a814, so master only
1 parent 4c56fa6 commit 1cd7808

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/gui/attributetable/qgsattributetablefiltermodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ QVariant QgsAttributeTableFilterModel::headerData( int section, Qt::Orientation
101101
return section + 1;
102102
else
103103
{
104-
int sourceSection = mapToSource( index( section, mColumnMapping.at( 0 ) == -1 ? 1 : 0 ) ).row();
104+
int sourceSection = mapToSource( index( section, ( !mColumnMapping.isEmpty() && mColumnMapping.at( 0 ) == -1 ) ? 1 : 0 ) ).row();
105105
return sourceModel()->headerData( sourceSection, orientation, role );
106106
}
107107
}

1 commit comments

Comments
 (1)

m-kuhn commented on Jun 20, 2016

@m-kuhn
Member

Thanks 👍

Please sign in to comment.