Fix: link events in sheet when there is nothing to link (#1053)

* create failing tests

* fix missing optional chaining
This commit is contained in:
Alex Christoffer Rasmussen
2024-06-06 22:38:52 +02:00
committed by GitHub
parent c2fa115946
commit 0e32b3a3af
2 changed files with 130 additions and 4 deletions
+2 -2
View File
@@ -49,8 +49,8 @@ export const parseRundown = (data: Partial<DatabaseModel>): OntimeRundown => {
if (isOntimeEvent(event)) {
if (event.linkStart) {
const prevEvent = getLastEvent(rundown).lastEvent;
event.linkStart = prevEvent.id;
const prevId = getLastEvent(rundown).lastEvent?.id ?? null;
event.linkStart = prevId;
}
newEvent = createEvent(event, eventIndex.toString());
// skip if event is invalid