From 5a9773fbc6b28e471c7f3d2ca3547c00a019eb55 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Tue, 23 Sep 2014 18:08:29 +0400 Subject: [PATCH] Fix NPE in GlobalMatchingVisitor --- .../structuralsearch/impl/matcher/GlobalMatchingVisitor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java index 5577db0d8540..2af5f0fa47c5 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/GlobalMatchingVisitor.java @@ -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;