ashbuilds / payload-ai

AI Plugin is a powerful extension for the Payload CMS, integrating advanced AI capabilities to enhance content creation and management.
MIT License
36 stars 7 forks source link

fix(plugin): prevent runtime error if no globals in payload config #40

Closed brunocrosier closed 1 month ago

brunocrosier commented 1 month ago

{...undefined} will result in

Uncaught TypeError: undefined is not iterable

This happens if the user does not have any existing globals in their payload config (and incomingConfig.globals is therefore undefined)

ashbuilds commented 1 month ago

@brunocrosier Awesome, thanks 🙏

brunocrosier commented 1 month ago

@brunocrosier Awesome, thanks 🙏

Love this plugin thanks for making it!