Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Commit 84a06f8

Browse files
committed
Added guard against exception detected in #45
1 parent 9c7cdac commit 84a06f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

library/src/main/java/com/etsy/android/grid/ExtendableListView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ public int getFirstVisiblePosition() {
18211821

18221822
@Override
18231823
public int getLastVisiblePosition() {
1824-
return Math.min(mFirstPosition + getChildCount() - 1, mAdapter.getCount() - 1);
1824+
return Math.min(mFirstPosition + getChildCount() - 1, mAdapter != null ? mAdapter.getCount() - 1 : 0);
18251825
}
18261826

18271827
// //////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)