Skip to content

Commit bad781a

Browse files
authored
Merge pull request #372 from hbraunDSP/empty-datetime-fix
BF: handle error if ContentDate and ContentTime are empty
2 parents 202f943 + a6172a4 commit bad781a

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
@@ -411,7 +411,7 @@ def get_formatted_scans_key_row(dcm_fn):
411411
time = dcm_data.ContentTime.split('.')[0]
412412
td = time + date
413413
acq_time = datetime.strptime(td, '%H%M%S%Y%m%d').isoformat()
414-
except AttributeError as exc:
414+
except (AttributeError, ValueError) as exc:
415415
lgr.warning("Failed to get date/time for the content: %s", str(exc))
416416
acq_time = None
417417
# add random string

0 commit comments

Comments
 (0)