diff --git a/src/app/attributetable/BeataModel.cpp b/src/app/attributetable/BeataModel.cpp index 6b3a5fa925f..4b16fe16f91 100644 --- a/src/app/attributetable/BeataModel.cpp +++ b/src/app/attributetable/BeataModel.cpp @@ -105,9 +105,11 @@ void BeataModel::featureDeleted( int fid ) { QgsDebugMsg( "entered." ); +#ifdef QGISDEBUG int idx = mIdRowMap[fid]; QgsDebugMsg( idx ); QgsDebugMsg( fid ); +#endif #if 0 --mFeatureCount; @@ -406,6 +408,9 @@ QVariant BeataModel::data( const QModelIndex &index, int role ) const mLastRow = ( QgsAttributeMap * ) & mFeat.attributeMap(); } + if( !mLastRow ) + return QVariant( "ERROR" ); + QVariant& val = ( *mLastRow )[ mAttributes[index.column()] ]; if ( val.isNull() ) @@ -537,6 +542,9 @@ QVariant BeataMemModel::data( const QModelIndex &index, int role ) const mLastRow = ( QgsAttributeMap * ) & mFeat.attributeMap(); } + if( !mLastRow ) + return QVariant( "ERROR" ); + QVariant &val = ( *mLastRow )[ mAttributes[index.column()] ]; if ( val.isNull() ) @@ -574,7 +582,7 @@ bool BeataMemModel::setData( const QModelIndex &index, const QVariant &value, in { mLastRowId = rowToId( index.row() ); mFeat = mFeatureMap[rowToId( index.row() )]; - mLastRow = ( QgsAttributeMap * )( &( mFeat.attributeMap() ) ); + mLastRow = ( QgsAttributeMap * ) &mFeat.attributeMap(); // QgsDebugMsg(mFeatureMap[rowToId(index.row())].id());