mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-29 02:49:13 +00:00
refactor: add guards around trivial index checks
This commit is contained in:
committed by
Carlos Valente
parent
242cefd35c
commit
426d42ab63
@@ -213,6 +213,9 @@ function add(rundown: Rundown, entry: OntimeEntry, afterId: EntryId | null, pare
|
||||
*/
|
||||
function edit(rundown: Rundown, patch: PatchWithId): { entry: OntimeEntry; didInvalidate: boolean } {
|
||||
const entry = rundown.entries[patch.id];
|
||||
if (!entry) {
|
||||
throw new Error(`Entry with id ${patch.id} not found`);
|
||||
}
|
||||
|
||||
// apply the patch and replace the entry
|
||||
const newEntry = applyPatchToEntry(entry, patch);
|
||||
|
||||
Reference in New Issue
Block a user