Skip to content

Commit f98af4b

Browse files
authored
Merge pull request #4 from quipper/AND-735_fix_qChart_empty_list_crash
added check to prevent Index Out of Bounds Exception
2 parents 4d1c372 + b06b333 commit f98af4b

File tree

1 file changed

+1
-1
lines changed
  • qandroidcomposechart/src/main/java/com/quipper/qandroidcomposechart/components

1 file changed

+1
-1
lines changed

qandroidcomposechart/src/main/java/com/quipper/qandroidcomposechart/components/DrawOnClickLabel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal fun DrawOnClickLabel(
2828
onWidthChange: (Float) -> Unit
2929
) {
3030

31-
if (offsetsIndexed.isNotEmpty()) {
31+
if (offsetsIndexed.isNotEmpty() && data.size > onClickIndex) {
3232

3333
val currentData = data[onClickIndex]
3434
val isRightPosition = onClickIndex > data.size.div(2)

0 commit comments

Comments
 (0)