Skip to content
Permalink
Browse files

Fix crash and corruption of project file when saving project with non…

… spatial layers. Fix issue preventing projects with non-spatial layers being loaded.

git-svn-id: http://svn.osgeo.org/qgis/trunk@14390 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Oct 17, 2010
1 parent 15ce2ed commit efa5c7ae58a05a29d0ec12b3f1e533661e3309bb
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/core/qgsvectorlayer.cpp
@@ -2499,9 +2499,12 @@ bool QgsVectorLayer::readXml( QDomNode & layer_node )
}

QString errorMsg;
if ( !readSymbology( layer_node, errorMsg ) )
if ( geometryType() != QGis::NoGeometry )
{
return false;
if ( !readSymbology( layer_node, errorMsg ) )
{
return false;
}
}

return mValid; // should be true if read successfully
@@ -2645,11 +2648,13 @@ bool QgsVectorLayer::writeXml( QDomNode & layer_node,

// renderer specific settings
QString errorMsg;
if ( !writeSymbology( layer_node, document, errorMsg ) )
if ( geometryType() != QGis::NoGeometry )
{
return false;
if ( !writeSymbology( layer_node, document, errorMsg ) )
{
return false;
}
}

return true;
} // bool QgsVectorLayer::writeXml

0 comments on commit efa5c7a

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