Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: unhandled exception when category is unknown#663

Merged
orestbida merged 1 commit into
orestbida:masterfrom
Idrinth:patch-1
Apr 1, 2024
Merged

fix: unhandled exception when category is unknown#663
orestbida merged 1 commit into
orestbida:masterfrom
Idrinth:patch-1

Conversation

@Idrinth

@Idrinth Idrinth commented Mar 19, 2024

Copy link
Copy Markdown
Contributor

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

@vercel

vercel Bot commented Mar 19, 2024

Copy link
Copy Markdown

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

@netlify

netlify Bot commented Mar 19, 2024

Copy link
Copy Markdown

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
Copy Markdown
Owner

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

@Idrinth

Idrinth commented Mar 21, 2024

Copy link
Copy Markdown
Contributor Author

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
@orestbida

Copy link
Copy Markdown
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