From 2fe2a395011da9452b396df5e9dec4af7d841108 Mon Sep 17 00:00:00 2001 From: Tommy Buonomo Date: Sat, 30 Apr 2022 16:18:10 +0200 Subject: [PATCH] [#135] Fix crash on refreshDotsSize method --- .../com/tbuonomo/viewpagerdotsindicator/BaseDotsIndicator.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/viewpagerdotsindicator/src/main/kotlin/com/tbuonomo/viewpagerdotsindicator/BaseDotsIndicator.kt b/viewpagerdotsindicator/src/main/kotlin/com/tbuonomo/viewpagerdotsindicator/BaseDotsIndicator.kt index 3e36a5a..eb6c8f3 100644 --- a/viewpagerdotsindicator/src/main/kotlin/com/tbuonomo/viewpagerdotsindicator/BaseDotsIndicator.kt +++ b/viewpagerdotsindicator/src/main/kotlin/com/tbuonomo/viewpagerdotsindicator/BaseDotsIndicator.kt @@ -170,9 +170,7 @@ abstract class BaseDotsIndicator @JvmOverloads constructor( } private fun refreshDotsSize() { - for (i in 0 until pager!!.currentItem) { - dots[i].setWidth(dotsSize.toInt()) - } + dots.forEach { it.setWidth(dotsSize.toInt()) } } // ABSTRACT METHODS AND FIELDS