Skip to content

Commit 93a56bb

Browse files
author
timlinux
committed
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/qgis@14390 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d797ade commit 93a56bb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/core/qgsvectorlayer.cpp

+10-5
Original file line numberDiff line numberDiff line change
@@ -2499,9 +2499,12 @@ bool QgsVectorLayer::readXml( QDomNode & layer_node )
24992499
}
25002500

25012501
QString errorMsg;
2502-
if ( !readSymbology( layer_node, errorMsg ) )
2502+
if ( geometryType() != QGis::NoGeometry )
25032503
{
2504-
return false;
2504+
if ( !readSymbology( layer_node, errorMsg ) )
2505+
{
2506+
return false;
2507+
}
25052508
}
25062509

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

26462649
// renderer specific settings
26472650
QString errorMsg;
2648-
if ( !writeSymbology( layer_node, document, errorMsg ) )
2651+
if ( geometryType() != QGis::NoGeometry )
26492652
{
2650-
return false;
2653+
if ( !writeSymbology( layer_node, document, errorMsg ) )
2654+
{
2655+
return false;
2656+
}
26512657
}
2652-
26532658
return true;
26542659
} // bool QgsVectorLayer::writeXml
26552660

0 commit comments

Comments
 (0)