appKODE / detekt-rules-compose

A collection of Detekt rules for Jetpack Compose
MIT License
136 stars 8 forks source link

False positive for "ConditionCouldBeLifted": lambda with parameter #31

Open dimsuz opened 10 months ago

dimsuz commented 10 months ago

This code reports ConditionCouldBeLifted while it shouldn't: technically it's legal to have pager with an "empty" page.

HorizontalPager(...) { pageIndex ->
  val branchEntry = entries.elementAtOrNull(pageIndex)
  if (branchEntry != null) { // <- reported here
    BranchDetailsWithAction(...)
  }
}