Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix crash when opening attribute table on non-spatial layer
  • Loading branch information
nyalldawson committed Aug 5, 2015
1 parent 2b8b942 commit df4c131
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsvectorlayer.sip
Expand Up @@ -798,7 +798,7 @@ class QgsVectorLayer : QgsMapLayer
*
* @return A list of fields
*/
const QgsFields fields() const;
QgsFields fields() const;

/**
* Returns the list of fields of this layer.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -526,7 +526,7 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
if ( role == FieldIndexRole )
return fieldId;

const QgsField& field = layer()->fields()[ fieldId ];
const QgsField& field = layer()->fields().at( fieldId );

QVariant::Type fldType = field.type();
bool fldNumeric = ( fldType == QVariant::Int || fldType == QVariant::Double || fldType == QVariant::LongLong );
Expand Down

0 comments on commit df4c131

Please sign in to comment.