Fix crash when plugin event not found
@@ -229,7 +229,7 @@ export const calculateAutoFadeEventIdNormalised = (
const events = require("../events").default;
let fadeEventId = "";
const checkEvent = (eventId: string) => (scriptEvent: ScriptEvent) => {
- if (!fadeEventId && events[scriptEvent.command].waitUntilAfterInitFade) {
+ if (!fadeEventId && events[scriptEvent.command]?.waitUntilAfterInitFade) {
if (scriptEvent.command === EVENT_FADE_IN) {
fadeEventId = "MANUAL";
} else {
@@ -258,7 +258,7 @@ export const calculateAutoFadeEventIdNormalised = (
if (childEvent?.args?.__comment) {
return false;
}
- if (events[childEvent.command].allowChildrenBeforeInitFade) {
+ if (events[childEvent.command]?.allowChildrenBeforeInitFade) {
return false;
}
return true;
