Skip to content

Commit

Permalink
Bugfix for fi mode of AVOID_NULL_CHECK
Browse files Browse the repository at this point in the history
### What's done:
 * Added a check for assignment operator when deciding if to put run block or not
 * Added tests
(#1293)
  • Loading branch information
sanyavertolet committed Oct 27, 2022
1 parent 8bed41d commit 62463ae
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ class NullChecksRule(configRules: List<RulesConfig>) : DiktatRule(
}
?.blockExpressionsOrSingle()
?.let { elements ->
elements.count() to elements.any {
element -> KtPsiUtil.isAssignment(element)
elements.count() to elements.any { element ->
KtPsiUtil.isAssignment(element)
}
}
?: Pair(0, false)
Expand Down

0 comments on commit 62463ae

Please sign in to comment.