Fix NPE in JavaNullabilityChecker when checking equals-calls
This NPE was introduced in ce41b5745a
Prior to the latter change there was a synthetic PSI element for each
equals-related call, thus callOperationNode was not null here.
== are intentionally treated as safe calls, but for nullability checker
it's not relevant, it only should report warnings on real safe-calls
This commit is contained in:
+2
-1
@@ -109,8 +109,9 @@ class JavaNullabilityChecker : AdditionalTypeChecker {
|
||||
}
|
||||
|
||||
if (safeAccess) {
|
||||
val safeAccessElement = c.call.callOperationNode?.psi ?: return
|
||||
doIfNotNull(receiverArgument.type, { dataFlowValue }, c) {
|
||||
c.trace.report(Errors.UNNECESSARY_SAFE_CALL.on(c.call.callOperationNode!!.psi, receiverArgument.type))
|
||||
c.trace.report(Errors.UNNECESSARY_SAFE_CALL.on(safeAccessElement, receiverArgument.type))
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user