瀏覽代碼

Protect agains missing images in Imaging dataset in statUtils.py

nixWorker 1 天之前
父節點
當前提交
246d0b8a3a
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      pythonScripts/statUtils.py

+ 6 - 1
pythonScripts/statUtils.py

@@ -50,7 +50,12 @@ def getImage(setup, row, field, extraPath=None):
     if extraPath!=None:
         pathList.append(extraPath)
     pathList.append(row[field])
-    remotePath='/'.join(pathList)
+    try:
+        #if row[field] is None, this fails
+        remotePath='/'.join(pathList)
+    except TypError:
+        #return marker for failed
+        return "NONE"
     urlPath=fb.formatPathURL(setup['project'],remotePath)
     localPath=os.path.join(setup['localDir'],row[field])
     if os.path.isfile(localPath):