File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -565,13 +565,18 @@ export class MesocycleAggregateRoot {
565565 } )
566566 . with ( { state : WorkoutExerciseState . pending } , pendingExercise => {
567567 const historicalResult = historicalResults . find ( result => result . exercise . id === pendingExercise . exercise . id )
568- if ( ! historicalResult ) {
569- throw new Error ( 'Historical result not found' )
570- }
571-
572568 const firstSet = pendingExercise . sets [ 0 ]
573- if ( ! firstSet ) {
574- throw new Error ( 'First set not found' )
569+
570+ if ( ! historicalResult || ! firstSet ) {
571+ return {
572+ exercise : pendingExercise . exercise ,
573+ sets : pendingExercise . targetSets ,
574+ reps : firstSet ?. reps ?? null ,
575+ weight : firstSet ?. weight ?? null ,
576+ lastTested1Rm : null ,
577+ projected1Rm : null ,
578+ exerciseStatus : pendingExercise . progressionType ,
579+ }
575580 }
576581
577582 return {
You can’t perform that action at this time.
0 commit comments