Skip to content

Commit

Permalink
QgsAttributeTableFilterModel::headerData(): fix crash on layer with n…
Browse files Browse the repository at this point in the history
…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 1cd7808
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetablefiltermodel.cpp
Expand Up @@ -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 );
}
}
Expand Down

1 comment on commit 1cd7808

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 1cd7808 Jun 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

Please sign in to comment.