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

Preventing an index access error on undefined #511

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Sanshain
Copy link

@Sanshain Sanshain commented Sep 2, 2024

I have faced with trouble when url comes as undefined (using nollup bundler). So it throws an error Cannot read property '0' of undefined. The problem I solved by a one-line check:

if (url && url[0] === "/")
/// instead of `if (url[0] === "/")`

Is it ok?

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