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

core(webfonts): Patches fonts gatherer so it doesn't throw an exception #4465

Merged
merged 3 commits into from
Feb 8, 2018

Conversation

wardpeet
Copy link
Collaborator

@wardpeet wardpeet commented Feb 8, 2018

fixes #4464

@wardpeet wardpeet changed the title Patches fonts audit so our gatherer doesn't throw core(webfonts): Patches fonts gatherer so it doesn't throw an exception Feb 8, 2018
@@ -146,7 +146,10 @@ class Fonts extends Gatherer {
).then(([loadedFonts, fontFaces]) => {
return loadedFonts.map(fontFace => {
const fontFaceItem = this._findSameFontFamily(fontFace, fontFaces);
fontFace.src = fontFaceItem.src || [];
fontFace.src = [];
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like we lost the case where .src is not an array but not sure if that's possible?

how abouts fontFace.src = (fontFaceItem && fontFaceItem.src) || []?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

your wish is my command!

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

thanks for finding and fixing so quick @wardpeet!

@patrickhulce patrickhulce merged commit b57a59d into master Feb 8, 2018
@patrickhulce patrickhulce deleted the patch/webfonts branch February 8, 2018 18:45
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.

TypeError: Cannot read property 'src' of undefined
4 participants