Skip to content

Commit 52c3b87

Browse files
committed
EQName PSI: Don't throw a NullPointerException if the rhs prefix or local name is null.
1 parent 0d86a04 commit 52c3b87

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/uk/co/reecedunn/intellij/plugin/xquery/psi/impl/xquery/XQueryEQNamePsiImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public boolean equals(Object other) {
5454
PsiElement lhsLocalName = getLocalName();
5555
PsiElement rhsLocalName = rhs.getLocalName();
5656
if ((lhsLocalName == null && rhsLocalName == null) ||
57-
(lhsLocalName != null && lhsLocalName.getText().equals(rhsLocalName.getText()))) {
57+
(lhsLocalName != null && rhsLocalName != null && lhsLocalName.getText().equals(rhsLocalName.getText()))) {
5858
PsiElement lhsPrefix = getPrefix();
5959
PsiElement rhsPrefix = rhs.getPrefix();
6060
return (lhsPrefix == null && rhsPrefix == null) ||
61-
(lhsPrefix != null && lhsPrefix.getText().equals(rhsPrefix.getText()));
61+
(lhsPrefix != null && rhsPrefix != null && lhsPrefix.getText().equals(rhsPrefix.getText()));
6262
}
6363
return false;
6464
}

0 commit comments

Comments
 (0)