Fix KNPE in evaluator (EA-89384)
This commit is contained in:
+11
-4
@@ -289,12 +289,19 @@ private fun findElementBefore(contextElement: PsiElement): PsiElement? {
|
|||||||
wrapInLambdaCall(delegateExpressionOrInitializer)
|
wrapInLambdaCall(delegateExpressionOrInitializer)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val getter = contextElement.getter!!
|
val getter = contextElement.getter
|
||||||
if (!getter.hasBlockBody()) {
|
val bodyExpression = getter?.bodyExpression
|
||||||
wrapInLambdaCall(getter.bodyExpression!!)
|
|
||||||
|
if (getter != null && bodyExpression != null) {
|
||||||
|
if (!getter.hasBlockBody()) {
|
||||||
|
wrapInLambdaCall(bodyExpression)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
(bodyExpression as KtBlockExpression).statements.first()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
(getter.bodyExpression as KtBlockExpression).statements.first()
|
contextElement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user