base: never throw in Xml_node::for_each_sub_node

Fixes #3231
This commit is contained in:
Norman Feske
2019-03-14 16:31:11 +01:00
committed by Christian Helmuth
parent d75c5f6722
commit 9438caa6a3
3 changed files with 18 additions and 7 deletions

View File

@ -891,15 +891,17 @@ class Genode::Xml_node
if (_num_sub_nodes == 0)
return;
Xml_node node = sub_node();
for (int i = 0; ; node = node.next()) {
try {
Xml_node node = sub_node();
for (int i = 0; ; node = node.next()) {
if (!type || node.has_type(type))
fn(node);
if (!type || node.has_type(type))
fn(node);
if (++i == _num_sub_nodes)
break;
}
if (++i == _num_sub_nodes)
break;
}
} catch (Nonexistent_sub_node) { }
}
/**