XPath: Minor error handling refactoring
Handle node type error before creating expression node
This commit is contained in:
parent
34b8c5908b
commit
6abf1d7c1a
1 changed files with 3 additions and 3 deletions
|
@ -11333,12 +11333,12 @@ PUGI__NS_BEGIN
|
|||
{
|
||||
_lexer.next();
|
||||
|
||||
xpath_ast_node* expr = parse_expression();
|
||||
if (!expr) return 0;
|
||||
|
||||
if (n->rettype() != xpath_type_node_set)
|
||||
return error("Predicate has to be applied to node set");
|
||||
|
||||
xpath_ast_node* expr = parse_expression();
|
||||
if (!expr) return 0;
|
||||
|
||||
n = alloc_node(ast_filter, n, expr, predicate_default);
|
||||
if (!n) return 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue