Skip to content

Commit caaa89f

Browse files
committed
Do not error if the batch positions list is empty
1 parent d7ed7cb commit caaa89f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/murfey/client/contexts/tomo_metadata.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,12 @@ def post_transfer(
257257
for_parsing = xml.read()
258258
batch_xml = xmltodict.parse(for_parsing)
259259

260-
batch_positions_list = batch_xml["BatchPositionsList"]["BatchPositions"][
261-
"BatchPositionParameters"
262-
]
260+
batch_positions_from_xml = batch_xml["BatchPositionsList"]["BatchPositions"]
261+
if not batch_positions_from_xml:
262+
logger.info("No batch positions yet")
263+
return
264+
265+
batch_positions_list = batch_positions_from_xml["BatchPositionParameters"]
263266
if isinstance(batch_positions_list, dict):
264267
# Case of a single batch
265268
batch_positions_list = [batch_positions_list]

0 commit comments

Comments
 (0)