fix(db): Fix accessing undefined lifecycle during retention cleanup

This commit is contained in:
FoxxMD
2026-06-24 19:29:35 +00:00
parent 2ae32ee19f
commit 6f8ca72ccf
@@ -417,12 +417,14 @@ export class DrizzlePlayRepository extends DrizzleBaseRepository<'plays'> {
}
compactedPlay = playRow.play;
compactedPlay.lifecycle = compactedPlay.lifecycle.map(x => {
if(x.inputs == undefined) {
return x;
}
return {...x, inputs: x.inputs.map(y => ({type: y.type, input: 'Removed by compaction'}))};
});
if(compactedPlay.lifecycle !== undefined) {
compactedPlay.lifecycle = compactedPlay.lifecycle.map(x => {
if(x.inputs == undefined) {
return x;
}
return {...x, inputs: x.inputs.map(y => ({type: y.type, input: 'Removed by compaction'}))};
});
}
}
const updater = this.db.update(plays);