Skip to content

Commit 36c031a

Browse files
authored
Moving array access for captcha _.isEmpty check
When upgrading to 2.3.6 from 2.3.5-p2, a new CAPTCHA zone "payment_processing_request" is added. If a customer has an existing session (from 2.3.5-p2 or prior), and tries to access checkout with their existing session data, checkout will fail to load because the check to see if captchaData[formId] exists is not a valid function call. _.isEmpty() only returns a boolean value, so it cannot be enumerated like an array. Array access syntax has been moved in to the check, rather than outside it.
1 parent 63434d2 commit 36c031a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ define([
5656
*/
5757
checkCustomerData: function (formId, captchaData, captcha) {
5858
if (!_.isEmpty(captchaData) &&
59-
!_.isEmpty(captchaData)[formId] &&
59+
!_.isEmpty(captchaData[formId]) &&
6060
captchaData[formId].timestamp > captcha.timestamp
6161
) {
6262
if (!captcha.isRequired() && captchaData[formId].isRequired) {

0 commit comments

Comments
 (0)