XPath: Minor error handling refactoring
Handle node type error before creating expression node
This commit is contained in:
parent
34b8c5908b
commit
6abf1d7c1a
@ -11333,12 +11333,12 @@ PUGI__NS_BEGIN
|
|||||||
{
|
{
|
||||||
_lexer.next();
|
_lexer.next();
|
||||||
|
|
||||||
xpath_ast_node* expr = parse_expression();
|
|
||||||
if (!expr) return 0;
|
|
||||||
|
|
||||||
if (n->rettype() != xpath_type_node_set)
|
if (n->rettype() != xpath_type_node_set)
|
||||||
return error("Predicate has to be applied to 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);
|
n = alloc_node(ast_filter, n, expr, predicate_default);
|
||||||
if (!n) return 0;
|
if (!n) return 0;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user