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

fix: unhandled exception when category is unknown #663

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

Idrinth
Copy link
Contributor

@Idrinth Idrinth commented Mar 19, 2024

The small change prevents passing undefined to a function that expects an Array by providing a fallback.

Copy link

vercel bot commented Mar 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
cookieconsent-docs ⬜️ Ignored (Inspect) Visit Preview Apr 1, 2024 5:34pm

Copy link

netlify bot commented Mar 19, 2024

Deploy Preview for cookieconsentv3-playground canceled.

Name Link
🔨 Latest commit 3758404
🔍 Latest deploy log https://app.netlify.com/sites/cookieconsentv3-playground/deploys/660af00fb39d0200084b8dd3

@orestbida
Copy link
Owner

Could you elaborate a bit more? Like, when is the error thrown, with what config.

@Idrinth
Copy link
Contributor Author

Idrinth commented Mar 21, 2024

Could you elaborate a bit more? Like, when is the error thrown, with what config.

Hi, yes of course. Whenever you enter a category that doesn't exist when checking for a service the whole call errors out, because it passes undefined to the next level function instead of an array.
I adjusted the code to also use a fallback, that works similar to a none-existing category in the category check.

…Category`

The small change prevents passing undefined to a function that expects an Array by providing a fallback.
@orestbida orestbida changed the title BUG: Prevent thrown TypeError when category is unknown fix: unhandled exception when category is unknown Apr 1, 2024
@orestbida orestbida merged commit fe00ed0 into orestbida:master Apr 1, 2024
7 checks passed
@orestbida
Copy link
Owner

Thanks for your contribution!

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