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

Handel undefined parameters in Array library helpers #353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shanemac10
Copy link

Array helpers.forEach was causing errors that resulted in status 500 errors in runtime when passed undefined or null values. Added if (!Array.isArray(array)) return ''; as a fast-fail measure to it and other Array helpers to handle bad parameters without causing errors. This fast-fail was already being used on multiple other helpers in this file, and was copied and added to those which might error without it. Added if (!Array.isArray(array)) array = []; to helpers.filter which should produce the similar safe result as the fast-fail.

Array helpers.forEach was causing errors that resulted in status 500 errors in runtime when passed undefined or null values. Added `if (!Array.isArray(array)) return '';`  as a fast-fail measure to it and other Array helpers to handle bad parameters without causing errors. This fast-fail was already being used on multiple other helpers in this file, and was copied and added to those which might error without it.
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.

1 participant