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: add optional chaining #1156

Merged
merged 4 commits into from
Feb 26, 2024
Merged

fix: add optional chaining #1156

merged 4 commits into from
Feb 26, 2024

Conversation

jacoblogan
Copy link
Contributor

Problem

Codegened code is throwing this error TypeError: undefined is not an object (evaluating 'record.ScanEvents.toArray') when the field is undefined.

Solution

Add optional chaining so that an error won't be thrown and instead the conditional empty array will be returned

Verification

Tests are showing the desired optional chaining.

Automated tests

  • Unit tests added/updated
  • E2E tests added/updated
  • N/A - (provide a reason)
  • deferred - (provide GitHub issue for tracking)

Housekeeping

  • No non-essential console logs
  • All new files contain license notice

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jacoblogan jacoblogan requested a review from a team as a code owner February 21, 2024 17:32
@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.86%. Comparing base (575cbcc) to head (8298ab1).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1156   +/-   ##
=======================================
  Coverage   93.86%   93.86%           
=======================================
  Files         150      150           
  Lines        6114     6114           
  Branches     1838     1838           
=======================================
  Hits         5739     5739           
  Misses        357      357           
  Partials       18       18           
Files Coverage Δ
...act/lib/forms/form-renderer-helper/relationship.ts 93.15% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 575cbcc...8298ab1. Read the comment docs.

@jacoblogan jacoblogan merged commit 70799cb into main Feb 26, 2024
11 checks passed
@jacoblogan jacoblogan deleted the form-error branch February 26, 2024 16:36
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.

4 participants