diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-01-29 21:53:23 -0800 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-01-29 21:53:23 -0800 |
commit | 6abf1d7c1a735cbec3b42cb569683d00b070f46c (patch) | |
tree | 31600aa68bcb329d48f0717df418bb560964eb13 /src/pugixml.cpp | |
parent | 34b8c5908b338fb00197a758c98ac36777cad35b (diff) |
XPath: Minor error handling refactoring
Handle node type error before creating expression node
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r-- | src/pugixml.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index ed878de..f52d236 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -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; |