Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent crashing when no items provided #141

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

julievalet
Copy link
Contributor

Hello there,

I use itemsjs in a Gatsby environnement, my items are loaded through API and sometimes it can return no items.
When no items is provided when indexing, it crashes when doing a search.

The crash occurs when doing a facet union:
Screenshot 2024-03-19 at 10 23 16 AM

Here is my fix for this issue.
I also added a test for this case in the search spec.

Really appreciate your work with this library.

Thank you for considering my fix.

@cigolpl cigolpl merged commit 7c70c1e into itemsapi:master Mar 19, 2024
1 check passed
@cigolpl
Copy link
Member

cigolpl commented Mar 19, 2024

Thank you Julie. Merged and bumped version to 2.1.25

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.

2 participants