Skip to content

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

Merged
patrickhulce merged 3 commits intomasterfrom
patch/webfonts
Feb 8, 2018
Merged

core(webfonts): Patches fonts gatherer so it doesn't throw an exception#4465
patrickhulce merged 3 commits intomasterfrom
patch/webfonts

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
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