summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slicer/xml/serializer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/slicer/xml/serializer.cpp b/slicer/xml/serializer.cpp
index f7281b3..4670012 100644
--- a/slicer/xml/serializer.cpp
+++ b/slicer/xml/serializer.cpp
@@ -211,13 +211,13 @@ namespace Slicer {
void
XmlSerializer::ModelTreeIterate(xmlpp::Element * n, const std::string & name, ModelPartPtr mp, HookCommonPtr hp)
{
- if (name.empty()) {
+ if (!mp || name.empty()) {
return;
}
if (hp && metaDataFlagSet(hp->GetMetadata(), md_attribute)) {
mp->GetValue(new XmlAttributeValueTarget(n, name));
}
- else if (mp) {
+ else {
ModelTreeProcessElement(n->add_child(name), mp);
}
}