Skip to content

Commit a6172a4

Browse files
committed
handle error if ContentDate and ContentTime are empty
1 parent 5cfb6f2 commit a6172a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

heudiconv/bids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def get_formatted_scans_key_row(dcm_fn):
370370
time = dcm_data.ContentTime.split('.')[0]
371371
td = time + date
372372
acq_time = datetime.strptime(td, '%H%M%S%Y%m%d').isoformat()
373-
except AttributeError as exc:
373+
except (AttributeError, ValueError) as exc:
374374
lgr.warning("Failed to get date/time for the content: %s", str(exc))
375375
acq_time = None
376376
# add random string

0 commit comments

Comments
 (0)