diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ConfigParser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp index 89f6d87..6092e66 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -395,15 +395,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); } |