mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
workaround notnull assertion EA-70428 - IAE: DomSemContributor.getParentDom
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user