init: consider lacking service name attribute

This patch makes init robust against invalid routing rules that lack a
name attribute in the '<service>' node. This situation may occur when
interactively editing routes in Sculpt.
This commit is contained in:
Norman Feske 2018-11-26 18:37:30 +01:00 committed by Christian Helmuth
parent 8015dbe8b7
commit 538c3a6692

View File

@ -64,7 +64,7 @@ namespace Init {
bool const service_matches =
service_node.has_type("any-service") ||
(service_node.has_type("service") &&
service_node.attribute("name").has_value(service_name.string()));
service_node.attribute_value("name", Service::Name()) == service_name);
if (!service_matches)
return false;