diff OrthancServer/Resources/Samples/ImportDicomFiles/OrthancImport.py @ 4973:17c91e054636

minor improvements
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 Apr 2022 12:04:48 +0200
parents cde17b68d73e
children 0ea402b4d901
line wrap: on
line diff
--- a/OrthancServer/Resources/Samples/ImportDicomFiles/OrthancImport.py	Mon Apr 04 09:52:54 2022 +0200
+++ b/OrthancServer/Resources/Samples/ImportDicomFiles/OrthancImport.py	Thu Apr 07 12:04:48 2022 +0200
@@ -116,7 +116,8 @@
     info = r.json()
     COUNT_DICOM += 1
 
-    if not info['ParentStudy'] in IMPORTED_STUDIES:
+    if (isinstance(info, dict) and
+        not info['ParentStudy'] in IMPORTED_STUDIES):
         IMPORTED_STUDIES.add(info['ParentStudy'])
         
         r2 = requests.get('%s/instances/%s/tags?short' % (args.url, info['ID']),