summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/configuration.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/common/configuration.cpp b/src/common/configuration.cpp
index 6b79b85e..9d0e81ee 100644
--- a/src/common/configuration.cpp
+++ b/src/common/configuration.cpp
@@ -55,16 +55,16 @@ bool Configuration::initialize(const std::string &filename)
for (node = node->xmlChildrenNode; node != NULL; node = node->next)
{
- if (xmlStrEqual(node->name, BAD_CAST "option"))
- {
- std::string key = XML::getProperty(node, "name", "");
- std::string value = XML::getProperty(node, "value", "");
-
- if (!key.empty() && !value.empty())
- {
- options[key] = value;
- }
- }
+ if (!xmlStrEqual(node->name, BAD_CAST "option"))
+ continue;
+ if (!XML::hasProperty(node, "name") || !XML::hasProperty(node, "value"))
+ continue;
+
+ std::string key = XML::getProperty(node, "name", std::string());
+ std::string value = XML::getProperty(node, "value", std::string());
+
+ if (!key.empty())
+ options[key] = value;
}
xmlFreeDoc(doc);