Skip to content

Conversation

@sashaodessa
Copy link

Description

What kind of change does this PR introduce? Bug fix

What is the current behavior? The circularSlice function returns an array of undefined values when called with an empty input array, due to modulo operation with zero ((index + i) % 0 results in NaN).

What is the new behavior? The function now returns an empty array [] for empty input arrays or non-positive item counts, preventing NaN index access and subsequent rendering issues.

Does this PR introduce a breaking change? No

Related Issue(s)

N/A - Internal code quality improvement

Other information

This fix prevents potential runtime errors when the circularSlice utility is used with empty arrays, ensuring consistent behavior and preventing downstream issues in components that rely on this utility.

@sashaodessa sashaodessa requested a review from a team as a code owner October 22, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant