Merge pull request #1741 from automatisch/guard-actions-triggers

fix: Guard actions and triggers properties of apps
This commit is contained in:
Ömer Faruk Aydın
2024-03-17 13:26:59 +01:00
committed by GitHub

View File

@@ -165,7 +165,7 @@ class Step extends Base {
if (!isTrigger || !appKey || !key) return null; if (!isTrigger || !appKey || !key) return null;
const app = await App.findOneByKey(appKey); const app = await App.findOneByKey(appKey);
const command = app.triggers.find((trigger) => trigger.key === key); const command = app.triggers?.find((trigger) => trigger.key === key);
return command; return command;
} }
@@ -175,7 +175,7 @@ class Step extends Base {
if (!isAction || !appKey || !key) return null; if (!isAction || !appKey || !key) return null;
const app = await App.findOneByKey(appKey); const app = await App.findOneByKey(appKey);
const command = app.actions.find((action) => action.key === key); const command = app.actions?.find((action) => action.key === key);
return command; return command;
} }