-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 console error for products without variants #3351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look more closely at the values you are checking for and when
lib/api/products.js
Outdated
} | ||
|
||
return false; | ||
if (current.ancestors) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've introduced a possible failure here because you are checking for current.ancestors
before checking if current
exists as is done below.
1483f9e
to
5403c51
Compare
I will always have this in mind. Thanks |
Tested and it works, just wondering if we could simplify the code a little. |
alright, I will work on it |
…variant-3349 Fix console error for products without variants
Resolve #3349
PR resolve console error displayed when variant does not exist in the PDP. This actually happens because the product variant value is empty hence a check is placed to make sure variant exists before checking for
indexOf
Test