workaround notnull assertion EA-70428 - IAE: DomSemContributor.getParentDom

This commit is contained in:
peter
2015-07-10 20:38:52 +02:00
parent af2ce7d610
commit d49de05320
2 changed files with 3 additions and 1 deletions
@@ -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();
@@ -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;