diff --git a/mesa/datacollection.py b/mesa/datacollection.py index 3fcd205c9c5..f5f6ead235b 100644 --- a/mesa/datacollection.py +++ b/mesa/datacollection.py @@ -184,7 +184,9 @@ def get_reports(agent): agent_records = map( get_reports, - model.schedule.agents if hasattr(model, "schedule") else model.agents, + model.schedule.agents + if hasattr(model, "schedule") and model.schedule is not None + else model.agents, ) return agent_records