Skip to content

Commit 44b840f

Browse files
authored
Only update indicators if RecyclerView still has adapter (#16)
1 parent 527717b commit 44b840f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

indicator-fast-scroll/src/main/java/com/reddit/indicatorfastscroll/FastScrollerView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class FastScrollerView @JvmOverloads constructor(
187187
if (!isUpdateItemIndicatorsPosted) {
188188
isUpdateItemIndicatorsPosted = true
189189
post {
190-
if (recyclerView!!.isAttachedToWindow) {
190+
if (recyclerView!!.run { isAttachedToWindow && adapter != null }) {
191191
updateItemIndicators()
192192
}
193193
isUpdateItemIndicatorsPosted = false

0 commit comments

Comments
 (0)