From bfb507336c4791d28159fb7ab6a3eb1e67672d45 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 7 Jan 2015 21:55:06 +0000 Subject: Move mp not null to cover all cases --- slicer/xml/serializer.cpp | 4 ++-- 1 file 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); } } -- cgit v1.2.3