Skip to content

Commit f7a89d4

Browse files
committed
catch missing task_id for chgcars
1 parent c26cdd6 commit f7a89d4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mp_api/client/mprester.py

+3
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,9 @@ def get_charge_density_from_material_id(
13471347
task_ids = self.get_task_ids_associated_with_material_id(
13481348
material_id, calc_types=[CalcType.GGA_Static, CalcType.GGA_U_Static]
13491349
)
1350+
if not task_ids:
1351+
return None
1352+
13501353
results: list[TaskDoc] = self.materials.tasks.search(
13511354
task_ids=task_ids, fields=["last_updated", "task_id"]
13521355
) # type: ignore

0 commit comments

Comments
 (0)