From 2e5915029f97838c48142b9701877bed67d570d9 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 11 Apr 2011 13:51:25 +0400 Subject: [PATCH] EA-26173 - NPE: TemplateBuilderImpl.replaceElement --- .../src/com/intellij/xml/actions/GenerateXmlTagAction.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java b/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java index f300a7f537ef..d47721b197b4 100644 --- a/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java +++ b/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java @@ -218,7 +218,9 @@ public class GenerateXmlTagAction extends SimpleCodeInsightAction { private static void replaceElements(XmlTag tag, TemplateBuilder builder) { for (XmlAttribute attribute : tag.getAttributes()) { XmlAttributeValue value = attribute.getValueElement(); - builder.replaceElement(value, TextRange.from(1, 0), new MacroCallNode(new CompleteMacro())); + if (value != null) { + builder.replaceElement(value, TextRange.from(1, 0), new MacroCallNode(new CompleteMacro())); + } } if ("<".equals(tag.getText())) { builder.replaceElement(tag, TextRange.from(1, 0), new MacroCallNode(new CompleteSmartMacro()));