Skip to content

Commit

Permalink
catch missing task_id for chgcars
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Feb 18, 2025
1 parent c26cdd6 commit f7a89d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mp_api/client/mprester.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,9 @@ def get_charge_density_from_material_id(
task_ids = self.get_task_ids_associated_with_material_id(
material_id, calc_types=[CalcType.GGA_Static, CalcType.GGA_U_Static]
)
if not task_ids:
return None

results: list[TaskDoc] = self.materials.tasks.search(
task_ids=task_ids, fields=["last_updated", "task_id"]
) # type: ignore
Expand Down

0 comments on commit f7a89d4

Please sign in to comment.