Skip to content

Commit

Permalink
[Carousel] Fixed crash when recyclerview has a size of zero.
Browse files Browse the repository at this point in the history
Resolves #3634

PiperOrigin-RevId: 573843130
  • Loading branch information
hunterstich authored and drchen committed Oct 17, 2023
1 parent fb9c1c6 commit 26c3129
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -254,7 +254,7 @@ public void onDetachedFromWindow(RecyclerView view, Recycler recycler) {

@Override
public void onLayoutChildren(Recycler recycler, State state) {
if (state.getItemCount() <= 0) {
if (state.getItemCount() <= 0 || getContainerSize() <= 0f) {
removeAndRecycleAllViews(recycler);
currentFillStartPosition = 0;
return;
Expand Down

0 comments on commit 26c3129

Please sign in to comment.