astriaai / headshots-starter

https://headshots-starter.vercel.app
MIT License
3.56k stars 575 forks source link

TypeError when iterating through headshots output on train-webhook #97

Closed GGalupo closed 5 months ago

GGalupo commented 5 months ago

If the output from train-webhook endpoint doesn't have enough items to fill headshots_part_2, headshots_part_3 or headshots_part_4, a TypeError will be thrown, because it's trying to iterate on undefined to create allHeadshots const.

This behavior makes the function execution to stop, and images are not saved on the database.

Output

Screenshot_3

Error message on Vercel console

Screenshot_2

I'll make a PR to fix this issue.

Marfuen commented 5 months ago

@GGalupo Hey, so I don't think this is an issue since if you use the headshots template 1:1 and the template workflow this will work.

If someone edits their workflow to not have those outputs then it would be up to them to update their code to show that too