KtUnaryExpression.baseExpression may be null (EA-78379)
This commit is contained in:
@@ -116,7 +116,7 @@ fun KtSimpleNameExpression.getReceiverExpression(): KtExpression? {
|
||||
return if (parent.getOperationToken() in OperatorConventions.IN_OPERATIONS) parent.right else parent.left
|
||||
}
|
||||
parent is KtUnaryExpression && parent.operationReference == this -> {
|
||||
return parent.baseExpression!!
|
||||
return parent.baseExpression
|
||||
}
|
||||
parent is KtUserType -> {
|
||||
val qualifier = parent.getQualifier()
|
||||
@@ -125,6 +125,7 @@ fun KtSimpleNameExpression.getReceiverExpression(): KtExpression? {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -245,7 +245,9 @@ class OperatorToFunctionIntention : SelfTargetingIntention<KtExpression>(KtExpre
|
||||
findCallName(result.left!!)
|
||||
}
|
||||
|
||||
is KtUnaryExpression -> findCallName(result.baseExpression!!)
|
||||
is KtUnaryExpression -> {
|
||||
result.baseExpression?.let { findCallName(it) }
|
||||
}
|
||||
|
||||
else -> result.getQualifiedElementSelector() as KtSimpleNameExpression?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user