diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomSemContributor.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomSemContributor.java index f5a68aab0ee5..d1145d297dc2 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/DomSemContributor.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomSemContributor.java @@ -208,7 +208,7 @@ public class DomSemContributor extends SemContributor { @Override public AttributeChildInvocationHandler fun(final XmlAttribute attribute) { final XmlTag tag = PhysicalDomParentStrategy.getParentTag(attribute); - final DomInvocationHandler handler = getParentDom(tag); + final DomInvocationHandler handler = tag == null ? null : getParentDom(tag); if (handler == null) return null; final String localName = attribute.getLocalName(); diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java b/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java index 3dba990044c8..63fe67dadeb8 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java @@ -47,10 +47,12 @@ public class PhysicalDomParentStrategy implements DomParentStrategy { return myDomManager.getDomHandler(parentTag); } + @Nullable public static XmlTag getParentTag(final XmlElement xmlElement) { return (XmlTag)getParentTagCandidate(xmlElement); } + @Nullable public static PsiElement getParentTagCandidate(final XmlElement xmlElement) { final PsiElement parent = xmlElement.getParent(); return parent instanceof XmlEntityRef ? parent.getParent() : parent;