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 issue 115 "Cannot read property 'type' of undefined" #116

Merged
merged 30 commits into from
Sep 8, 2020
Merged

Fix issue 115 "Cannot read property 'type' of undefined" #116

merged 30 commits into from
Sep 8, 2020

Conversation

JuanMaRuiz
Copy link
Contributor

@JuanMaRuiz JuanMaRuiz commented Sep 3, 2020

Add new condition to opportunityRules method to avoid failure when a rules does not have details property

fixes: #115

JuanMaRuiz and others added 30 commits October 26, 2019 17:11
- Removed call to api.
- Added test to options handler instead
- Merge branch 'feature-optimizing-test' of https://github.com/JuanMaRuiz/psi into feature-optimizing-test
- Removed api-response-test
Co-Authored-By: Shane Exterkamp <shaneexterkamp5@gmail.com>
Co-Authored-By: Shane Exterkamp <shaneexterkamp5@gmail.com>
* Add new condition to opportunityRules method to avoid failure when
a rules does not have details property
Copy link
Collaborator

@exterkamp exterkamp left a comment

Choose a reason for hiding this comment

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

Restarting Travis b/c it failed on a 429.

@@ -59,7 +59,7 @@ const opportunities = lighthouseResult => {

const opportunityRules = rules.filter(rule => {
const {details} = audits[rule.id];
return details.type === 'opportunity' && details.overallSavingsMs > 0;
return Boolean(details) && details.type === 'opportunity' && details.overallSavingsMs > 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a double ! guy, but this wfm 👍

@JuanMaRuiz
Copy link
Contributor Author

Restarting Travis b/c it failed on a 429.

It seems that now is working properly.

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.

Issues with default outputting of specific sites
2 participants