diff --git a/xml/xml-analysis-impl/src/com/intellij/xml/util/CollapseTagIntention.java b/xml/xml-analysis-impl/src/com/intellij/xml/util/CollapseTagIntention.java index 5942af7b89cf..3b39ef3128bf 100644 --- a/xml/xml-analysis-impl/src/com/intellij/xml/util/CollapseTagIntention.java +++ b/xml/xml-analysis-impl/src/com/intellij/xml/util/CollapseTagIntention.java @@ -73,7 +73,10 @@ public class CollapseTagIntention implements LocalQuickFix, IntentionAction { @Override public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException { - applyFix(project, getTag(editor, file)); + XmlTag tag = getTag(editor, file); + if (tag != null) { + applyFix(project, tag); + } } private static XmlTag getTag(Editor editor, PsiFile file) {