Skip to content

Commit cef1266

Browse files
Fix #409: checkFormat fail for null input
Patched in the function checkFormat itself, instead of the code which calls it
1 parent 5689c7e commit cef1266

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cwltool/process.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ def formatSubclassOf(fmt, cls, ontology, visited):
344344
def checkFormat(actualFile, inputFormats, ontology):
345345
# type: (Union[Dict[Text, Any], List, Text], Union[List[Text], Text], Graph) -> None
346346
for af in aslist(actualFile):
347+
if not af: continue
347348
if "format" not in af:
348349
raise validate.ValidationException(u"Missing required 'format' for File %s" % af)
349350
for inpf in aslist(inputFormats):
@@ -551,7 +552,7 @@ def _init_job(self, joborder, **kwargs):
551552
if self.formatgraph:
552553
for i in self.tool["inputs"]:
553554
d = shortname(i["id"])
554-
if d in builder.job and i.get("format") and builder.job[d]:
555+
if d in builder.job and i.get("format"):
555556
checkFormat(builder.job[d], builder.do_eval(i["format"]), self.formatgraph)
556557

557558
builder.bindings.extend(builder.bind_input(self.inputs_record_schema, builder.job))

0 commit comments

Comments
 (0)