ashbuilds / payload-ai

AI Plugin is a powerful extension for the Payload CMS, integrating advanced AI capabilities to enhance content creation and management.
Other
66 stars 10 forks source link

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

Closed brunocrosier closed 2 months ago

brunocrosier commented 2 months 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 2 months ago

@brunocrosier Awesome, thanks 🙏

brunocrosier commented 2 months ago

@brunocrosier Awesome, thanks 🙏

Love this plugin thanks for making it!