From d617b1d8694c019790ee7a2271fc53b32926f935 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 24 May 2017 18:25:15 +0300 Subject: [PATCH] Fix IfThenToSafeAccessIntention broken by refactoring Broken in 66c5717adc121cb155d59f46ba03f5954950bc83 --- .../intentions/IfThenToSafeAccessIntention.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToSafeAccessIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToSafeAccessIntention.kt index fc36e6cf532..4554c1d6258 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToSafeAccessIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToSafeAccessIntention.kt @@ -69,11 +69,10 @@ class IfThenToSafeAccessIntention : SelfTargetingOffsetIndependentIntention false + negatedClause == null && baseClause.isUsedAsExpression(context) -> false + negatedClause != null && !negatedClause.isNullExpression() -> false + else -> baseClause.evaluatesTo(receiverExpression) || baseClause.hasFirstReceiverOf(receiverExpression) } }