diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImpl.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImpl.java index e36b705cf8ce..92b6568c28c0 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImpl.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/MatcherImpl.java @@ -145,7 +145,10 @@ public class MatcherImpl { visitor.matchContext(matchedNodes); } finally { matchedNodes.reset(); - matchContext.getOptions().setScope(null); + final MatchOptions options = matchContext.getOptions(); + if (options != null) { + options.setScope(null); + } } }