Skip to content

Commit 4ef976b

Browse files
committed
Fixed fatal crash when no indicator was used.
1 parent d9df7e3 commit 4ef976b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/app.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
9191
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
9292
</content>
93-
<orderEntry type="jdk" jdkName="Android API 23 Platform (1)" jdkType="Android SDK" />
93+
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
9494
<orderEntry type="sourceFolder" forTests="false" />
9595
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
9696
<orderEntry type="library" exported="" name="appcompat-v7-23.0.0" level="project" />

lib/src/main/java/com/turingtechnologies/materialscrollbar/MaterialScrollBar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public float calculateScrollProgress(RecyclerView recyclerView) {
305305
int indexOfLastFullyVisibleItemInFirstSection = numItemsInList - numScrollableSectionsInList - 1;
306306

307307
int currentSection = lastFullyVisiblePosition - indexOfLastFullyVisibleItemInFirstSection;
308-
if(sectionIndicator.getVisibility() == VISIBLE){
308+
if(sectionIndicator != null && sectionIndicator.getVisibility() == VISIBLE){
309309
if(currentSection == 0){
310310
sectionIndicator.setCharacter(((INameableAdapter)recyclerView.getAdapter()).getCharacterForElement(currentSection));
311311
} else {

0 commit comments

Comments
 (0)