Skip to content

Commit

Permalink
add null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas committed Sep 30, 2022
1 parent 96f965b commit 47d74a8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ fun LineChart(
lineChartData = lineChartData,
chartDrawableArea = chartDrawableArea,
touchEvent = touchEvent
)?.also {
if (index != -1) onSelection?.invoke(it, lineChartData.points[it], touchEvent)
)?.also { index ->
if (index != -1)
onSelection?.invoke(index, lineChartData.points[index], touchEvent)
}
}

Expand Down

0 comments on commit 47d74a8

Please sign in to comment.