From d9f33bb09f3b13eab3839a660c0112d6033481a3 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 3 Jul 2015 17:46:10 +0200 Subject: Allow empty component labels --- src/ConfigParser.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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("label"); + string componentlabel = pt_comp.get("label", ""); string componentshortlabel(componentlabel); try { componentshortlabel = pt_comp.get("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); } -- cgit v1.2.3