Closed Nekonyx closed 2 years ago
I'd suggest to consider enabling the compilerOptions.noUncheckedIndexedAccess
flag in the https://github.com/ProtonMail/WebClients/blob/main/tsconfig.base.json file. This would allow squeezing more value out of the TypeScript. So the issue like this would likely be spotted by a compiler as the randomOption
var will be treated as "possibly undefined".
Any updates? I can't check my emails for about a week.
Thank you for the report @Nekonyx. We will push something today for this.
Correction: Probably not today. Tomorrow more likely
Fixed in [9364a28f42605150cffaa936e5abb837cd0cd7b9] Now it works, thanks 😄
If
filteredOptions
is an empty array: https://github.com/ProtonMail/WebClients/blob/8d7f8a902034405988bd70431c714e9fdbb37a1d/applications/mail/src/app/components/view/WelcomePaneBanner.tsx#L324Then random element from it throws an exception later: https://github.com/ProtonMail/WebClients/blob/8d7f8a902034405988bd70431c714e9fdbb37a1d/applications/mail/src/app/components/view/WelcomePaneBanner.tsx#L326