zorchenhimer / MoviePolls

Voting to decide on a movie to watch with MovieNight
https://discord.gg/F2VSgjJ
16 stars 6 forks source link

Prevent nil dereference errors while importing data from APIs #113

Open CptPie opened 3 years ago

CptPie commented 3 years ago

While my previous approach was to trust the API values apparently they keep causing issues.

Hence it would be a sane approach to check the API return values for null, emptystring etc. before assigning/processing them.

Particularly tmdb poster paths apparently can be null which just causes a coredump...

To prevent this from happening we should sanity check everything according to the relevant API definitions (i.e. if a field can return null or not).