learn-ocean / ocean-academy

Official repo of Ocean Academy
https://OceanAcademy.io
MIT License
33 stars 17 forks source link

fix uncaught type error for courses without progress, e.g. first coursework #120

Closed DOling closed 2 years ago

DOling commented 2 years ago

Debug session unveiled a filter action on a possibly undefined array.

MeMent0L commented 2 years ago

Oh! So you did submit a fix, how awesome!!

We will have to rely on @mwmouawad's expert eye before we proceed to merging. If you're interested in joining the team we will welcome you with open arms!

DOling commented 2 years ago

You're welcome. I am not a experienced Typescript developer. IMO the error could be caught much earlier. Maybe where the course object is initialized. But unfortunately I have not found the place in the code. I also have no experience with the react framework. :roll_eyes: So I'm curious to hear @mwmouawad's opinion.

mwmouawad commented 2 years ago

Hello @DOling, thank you very much for your support! It is better to check the exception before and not inside the helper to make it as functional as possible. I have pushed a bug fix here #121. Still thank you very much for participating in Ocean's Academy repo and helping us making the platform better!

DOling commented 2 years ago

Hi @mwmouawad, thank you very much for your feedback. Your solution is exactly what I was looking for from the beginning. Thanks!