Commit 6059bce
fix(gatsby-image): ensure that currentSrc exists (#13287)
* 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`.
* 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` URL1 parent 494ad07 commit 6059bce
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
0 commit comments