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: provide initial value for .reduce() call (backport #42419) #42437

Merged

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 22, 2024

Fixes the error "TypeError: Reduce of empty array with no initial value" (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Reduce_of_empty_array_with_no_initial_value#invalid_cases) that would show up in the browser console when creating or opening a Sales Invoice.

If the array was empty (i.e. no overdue payments), .reduce() would raise the above error because an initial value was not provided. By providing false as initial value, the UX stays identical but we get rid of the error.

This had no noticeable impact because it is the last part of the function.


This is an automatic backport of pull request #42419 done by Mergify.

@barredterra barredterra merged commit 8141c65 into version-15-hotfix Jul 23, 2024
6 checks passed
@barredterra barredterra deleted the mergify/bp/version-15-hotfix/pr-42419 branch July 23, 2024 11:06
@barredterra barredterra removed their assignment Jul 23, 2024
@frappe-pr-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 15.31.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants