Fix crash when running automations with an app action trigger without parameters

This commit is contained in:
Andrew Kingston 2022-06-13 10:56:50 +01:00
parent 3a33f5b376
commit caef092f8a
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ exports.externalTrigger = async function (
// values are likely to be submitted as strings, so we shall convert to correct type
const coercedFields = {}
const fields = automation.definition.trigger.inputs.fields
for (let key of Object.keys(fields)) {
for (let key of Object.keys(fields || {})) {
coercedFields[key] = coerce(params.fields[key], fields[key])
}
params.fields = coercedFields