summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ConfigParser.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index 8c5cbaa..443e26d 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -415,15 +415,17 @@ void parse_ptree(boost::property_tree::ptree& pt,
component->type = component_type;
int success = -5;
- string componentlabel = pt_comp.get<string>("label");
+ string componentlabel = pt_comp.get("label", "");
string componentshortlabel(componentlabel);
try {
componentshortlabel = pt_comp.get<string>("shortlabel");
success = component->label.setLabel(componentlabel, componentshortlabel);
}
catch (ptree_error &e) {
- etiLog.level(warn) << "Component short label undefined, "
- "truncating label " << componentlabel;
+ if (not componentlabel.empty()) {
+ etiLog.level(warn) << "Component short label undefined, "
+ "truncating label " << componentlabel;
+ }
success = component->label.setLabel(componentlabel);
}