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(gatsby-image): ensure that currentSrc exists #13287

Merged
merged 2 commits into from
Apr 11, 2019

Commits on Apr 11, 2019

  1. Ensure that currentSrc exists

    Trying to read `currentSrc` before it has been set throws an `Unable to get property 'length' of undefined or null reference` error.
    It should be an empty string, but IE11 can return `undefined`.
    thebuilder authored Apr 11, 2019
    Configuration menu
    Copy the full SHA
    dfa4fb2 View commit details
    Browse the repository at this point in the history
  2. Check if the currentSrc has a value

    Instead of reading the `length`, we can just check to see if it's a value. This ensures it's not `undefined` and that it has a valid `src` URL
    thebuilder authored Apr 11, 2019
    Configuration menu
    Copy the full SHA
    a7509ca View commit details
    Browse the repository at this point in the history