Skip to content
Permalink
Browse files

Fix crash when opening attribute table on non-spatial layer

  • Loading branch information
nyalldawson committed Aug 5, 2015
1 parent 2b8b942 commit df4c1311ad3ee160c8da9deb9304f185881fd607
Showing with 2 additions and 2 deletions.
  1. +1 −1 python/core/qgsvectorlayer.sip
  2. +1 −1 src/gui/attributetable/qgsattributetablemodel.cpp
@@ -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.
@@ -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 );

0 comments on commit df4c131

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