aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-03 17:46:10 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-03 17:46:10 +0200
commitd9f33bb09f3b13eab3839a660c0112d6033481a3 (patch)
tree5479311670ecc95f69d5f9cfeace8d4b51c85527
parent262a43fc5dcc04731a8951ee44555f582f7e8106 (diff)
downloaddabmux-d9f33bb09f3b13eab3839a660c0112d6033481a3.tar.gz
dabmux-d9f33bb09f3b13eab3839a660c0112d6033481a3.tar.bz2
dabmux-d9f33bb09f3b13eab3839a660c0112d6033481a3.zip
Allow empty component labels
-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);
}