Fix NPE in GlobalMatchingVisitor

This commit is contained in:
Kirill Likhodedov
2014-09-23 18:12:35 +04:00
parent ba2fd6f490
commit 5a9773fbc6
@@ -188,6 +188,9 @@ public class GlobalMatchingVisitor extends AbstractMatchingVisitor {
* @param elements the element for which the sons are looked for match
*/
public void matchContext(final NodeIterator elements) {
if (matchContext == null) {
return;
}
final CompiledPattern pattern = matchContext.getPattern();
final NodeIterator patternNodes = pattern.getNodes().clone();
final MatchResultImpl saveResult = matchContext.hasResult() ? matchContext.getResult() : null;