From d27d994431b23101a47fa0f1092055e82fb2d4d2 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 11 Oct 2011 12:44:13 +0200 Subject: [PATCH] bug #847: User load fails if there is no template. Needs a proper onedb update method. --- src/um/User.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/um/User.cc b/src/um/User.cc index 6810fe4009..0d92f26c65 100644 --- a/src/um/User.cc +++ b/src/um/User.cc @@ -166,11 +166,13 @@ int User::from_xml(const string& xml) // Get associated metadata for the user ObjectXML::get_nodes("/USER/TEMPLATE", content); - if (!content.empty()) + if (content.empty()) { - rc += obj_template->from_xml_node(content[0]); + return -1; } + rc += obj_template->from_xml_node(content[0]); + ObjectXML::free_nodes(content); if (rc != 0)