[QGIS Commit] r10433 - trunk/qgis/src/app/attributetable

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Mar 27 22:02:00 EDT 2009


Author: jef
Date: 2009-03-27 22:02:00 -0400 (Fri, 27 Mar 2009)
New Revision: 10433

Modified:
   trunk/qgis/src/app/attributetable/BeataModel.cpp
Log:
fix beata crash

Modified: trunk/qgis/src/app/attributetable/BeataModel.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/BeataModel.cpp	2009-03-28 00:32:47 UTC (rev 10432)
+++ trunk/qgis/src/app/attributetable/BeataModel.cpp	2009-03-28 02:02:00 UTC (rev 10433)
@@ -105,9 +105,11 @@
 {
   QgsDebugMsg( "entered." );
 
+#ifdef QGISDEBUG
   int idx = mIdRowMap[fid];
   QgsDebugMsg( idx );
   QgsDebugMsg( fid );
+#endif
 
 #if 0
   --mFeatureCount;
@@ -406,6 +408,9 @@
     mLastRow = ( QgsAttributeMap * ) & mFeat.attributeMap();
   }
 
+  if( !mLastRow )
+    return QVariant( "ERROR" );
+
   QVariant& val = ( *mLastRow )[ mAttributes[index.column()] ];
 
   if ( val.isNull() )
@@ -537,6 +542,9 @@
     mLastRow = ( QgsAttributeMap * ) & mFeat.attributeMap();
   }
 
+  if( !mLastRow )
+    return QVariant( "ERROR" );
+
   QVariant &val = ( *mLastRow )[ mAttributes[index.column()] ];
 
   if ( val.isNull() )
@@ -574,7 +582,7 @@
   {
     mLastRowId = rowToId( index.row() );
     mFeat = mFeatureMap[rowToId( index.row() )];
-    mLastRow = ( QgsAttributeMap * )( &( mFeat.attributeMap() ) );
+    mLastRow = ( QgsAttributeMap * ) &mFeat.attributeMap();
 
 
 // QgsDebugMsg(mFeatureMap[rowToId(index.row())].id());



More information about the QGIS-commit mailing list