diff --git a/bnpm/optimization.py b/bnpm/optimization.py index 2730c1e..c054828 100644 --- a/bnpm/optimization.py +++ b/bnpm/optimization.py @@ -307,7 +307,7 @@ def check( else: duration = 0 elif self.duration_type == 'trials': - duration = sum([t.duration.total_seconds() for t in study.trials]) + duration = sum([t.duration.total_seconds() for t in study.trials if t.duration is not None]) else: raise ValueError(f"duration_type '{self.duration_type}' not recognized")