mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 19:03:47 +00:00
refactor: add guards around trivial index checks
This commit is contained in:
committed by
Carlos Valente
parent
242cefd35c
commit
426d42ab63
@@ -150,7 +150,9 @@ async function setAutomation(newData: AutomationSettings): ReadonlyPromise<Autom
|
||||
|
||||
function getRundown(rundownKey: string): Readonly<Rundown> {
|
||||
if (!(rundownKey in db.data.rundowns)) throw new Error(`Rundown with id: ${rundownKey} not found`);
|
||||
return db.data.rundowns[rundownKey];
|
||||
const rundown = db.data.rundowns[rundownKey];
|
||||
if (!rundown) throw new Error(`Rundown with id: ${rundownKey} not found`);
|
||||
return rundown;
|
||||
}
|
||||
|
||||
async function deleteRundown(rundownKey: string): Promise<ProjectRundowns> {
|
||||
|
||||
Reference in New Issue
Block a user