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 9d38fa938f
commit d8c37eb0b1
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