diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-01-07 21:55:06 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-01-07 21:55:06 +0000 |
commit | bfb507336c4791d28159fb7ab6a3eb1e67672d45 (patch) | |
tree | 3adb56c1f0218957b5d11a6c51a05bf945e30bc7 | |
parent | Allow GetChild without a name (think JSON style) and require name to be corre... (diff) | |
download | slicer-bfb507336c4791d28159fb7ab6a3eb1e67672d45.tar.bz2 slicer-bfb507336c4791d28159fb7ab6a3eb1e67672d45.tar.xz slicer-bfb507336c4791d28159fb7ab6a3eb1e67672d45.zip |
Move mp not null to cover all cases
-rw-r--r-- | slicer/xml/serializer.cpp | 4 |
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); } } |