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: don't fail when 'src' and 'href' are undefined #7

Merged
merged 2 commits into from
Jun 24, 2021
Merged

fix: don't fail when 'src' and 'href' are undefined #7

merged 2 commits into from
Jun 24, 2021

Conversation

erezrokah
Copy link
Contributor

Hi 👋

Thank you for this great plugin 🚀

While working on gatsbyjs/gatsby#31909 I hit a bug where src and href can be undefined causing the plugin to crash.

I can workaround by supplying a function, but thought it will be good to fix this in the plugin.

Added a test case that reproduces the bug.

Copy link
Owner

@swimmadude66 swimmadude66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really appreciate you taking a look at this! I left a comment for what I think is a better fix to this bug, but if you make those changes I'll happily merge this in

src/plugin.ts Outdated Show resolved Hide resolved
Copy link
Owner

@swimmadude66 swimmadude66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@swimmadude66 swimmadude66 merged commit e09f740 into swimmadude66:develop Jun 24, 2021
@erezrokah erezrokah deleted the fix/undefined_assetUrl branch June 27, 2021 08:50
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