Skip to content

Commit

Permalink
Fix crash and corruption of project file when saving project with non…
Browse files Browse the repository at this point in the history
… 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 committed Oct 17, 2010
1 parent 15ce2ed commit efa5c7a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit efa5c7a

Please sign in to comment.