Skip to content
Permalink
Browse files

QgsAttributeTableFilterModel::headerData(): fix crash on layer with n…

…o 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
  • Loading branch information
rouault committed Jun 20, 2016
1 parent 4c56fa6 commit 1cd78083f868a3b2bc813b02783763ed5c9ed937
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gui/attributetable/qgsattributetablefiltermodel.cpp
@@ -101,7 +101,7 @@ QVariant QgsAttributeTableFilterModel::headerData( int section, Qt::Orientation
return section + 1;
else
{
int sourceSection = mapToSource( index( section, mColumnMapping.at( 0 ) == -1 ? 1 : 0 ) ).row();
int sourceSection = mapToSource( index( section, ( !mColumnMapping.isEmpty() && mColumnMapping.at( 0 ) == -1 ) ? 1 : 0 ) ).row();
return sourceModel()->headerData( sourceSection, orientation, role );
}
}

1 comment on commit 1cd7808

@m-kuhn

This comment has been minimized.

Copy link
Member

m-kuhn commented on 1cd7808 Jun 20, 2016

Thanks 👍

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