[QGIS Commit] r15110 - trunk/qgis/src/plugins/roadgraph

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Jan 31 05:46:46 EST 2011


Author: stopa85
Date: 2011-01-31 02:46:46 -0800 (Mon, 31 Jan 2011)
New Revision: 15110

Modified:
   trunk/qgis/src/plugins/roadgraph/linevectorlayerdirector.cpp
Log:
fix: Road graph plugin crash qgis when use spatelite as source layer

Modified: trunk/qgis/src/plugins/roadgraph/linevectorlayerdirector.cpp
===================================================================
--- trunk/qgis/src/plugins/roadgraph/linevectorlayerdirector.cpp	2011-01-31 06:48:49 UTC (rev 15109)
+++ trunk/qgis/src/plugins/roadgraph/linevectorlayerdirector.cpp	2011-01-31 10:46:46 UTC (rev 15110)
@@ -70,8 +70,14 @@
 
   builder->setSourceCrs( vl->crs() );
   QgsAttributeList la;
-  la.push_back( mDirectionFieldId );
-  la.push_back( mSpeedFieldId );
+  if ( mDirectionFieldId != -1 )
+  {
+    la.push_back( mDirectionFieldId );
+  }
+  if ( mSpeedFieldId != -1 )
+  {
+    la.push_back( mSpeedFieldId );
+  }
 
   SpeedUnit su = SpeedUnit::byName( mSpeedUnitName );
 



More information about the QGIS-commit mailing list