CruGlobal / conf-registration-web

Event Registration Tool
https://www.eventregistrationtool.com
MIT License
2 stars 1 forks source link

EVENT-776 - Foreign Addresses #805

Closed wrandall22 closed 2 years ago

wrandall22 commented 2 years ago

This reverts the revert of #803 and fixes the bug which caused us to revert.

wrandall22 commented 2 years ago

Basically what was happening is that old events (ones created before this code) do not necessarily have a country, so answer.country === '' at the point of the allCountries.find() call. This lead to index 2 being called on undefined. If we check for country being empty first, we don't run into this issue.

wrandall22 commented 2 years ago

cc @Benjamin-deVries just fyi

wrandall22 commented 2 years ago

Only thing to review here is the 2nd commit. f55fed5