summaryrefslogtreecommitdiff
path: root/src/xpath.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/xpath.cc')
-rw-r--r--src/xpath.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/xpath.cc b/src/xpath.cc
index 98988c64..f779ebc6 100644
--- a/src/xpath.cc
+++ b/src/xpath.cc
@@ -1208,16 +1208,11 @@ value_t xpath_t::op_t::calc(scope_t& scope)
case ATTR_ID:
case ATTR_NAME:
- if (optional<value_t> value =
+ if (optional<value_t&> value =
kind == ATTR_ID ? current_xml_node(scope).get_attr(as_name()) :
current_xml_node(scope).get_attr(as_string()))
return *value;
- else
- throw_(calc_error, "Attribute '"
- << (kind == ATTR_ID ?
- *current_xml_node(scope).document().lookup_name(as_long()) :
- as_string().c_str())
- << "' was not found");
+
break;
case O_NEQ: