Skip to content

Commit fc7e1aa

Browse files
committed
Return empty dict instead of None for '_parse_autotem_metadata' function
1 parent f269d7e commit fc7e1aa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • src/murfey/client/contexts

src/murfey/client/contexts/fib.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,24 +422,24 @@ def _parse_autotem_metadata(self, file: Path):
422422
along with the configured milling steps and their completion status.
423423
"""
424424

425+
all_site_info: dict[int, LamellaSiteInfo] = {}
425426
try:
426427
root = ET.parse(file).getroot()
427428
except Exception:
428429
logger.warning(f"Error parsing file {str(file)}", exc_info=True)
429-
return None
430+
return all_site_info
430431

431432
# Get the project name
432433
if (project_name := _parse_xml_text(root, ".//Project/Name", str)) is None:
433434
logger.warning("Metadata file has no project name")
434-
return None
435+
return all_site_info
435436

436437
# Find all the Site nodes
437438
if not (sites := root.findall(".//Sites/Site")):
438439
logger.warning(f"No site information found in {str(file)}")
439-
return None
440+
return all_site_info
440441

441442
# Iterate through Site nodes
442-
all_site_info: dict[int, LamellaSiteInfo] = {}
443443
for site in sites:
444444
# Extract site name and number
445445
if (site_name := _parse_xml_text(site, "Name", str)) is None:

0 commit comments

Comments
 (0)