Skip to content

Commit 1074b1b

Browse files
authored
Merge pull request #410 from SciDAP/master
Fix #409: checkFormat fails for Null input
2 parents a5b0fc8 + 0f33378 commit 1074b1b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cwltool/process.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ 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:
348+
continue
347349
if "format" not in af:
348350
raise validate.ValidationException(u"Missing required 'format' for File %s" % af)
349351
for inpf in aslist(inputFormats):

cwltool/workflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ def match_types(sinktype, src, iid, inputobj, linkMerge, valueFrom):
6666
return True
6767
elif isinstance(src.parameter["type"], list):
6868
# Source is union type
69-
# Check that every source type is compatible with the sink.
69+
# Check that at least one source type is compatible with the sink.
7070
for st in src.parameter["type"]:
7171
srccopy = copy.deepcopy(src)
7272
srccopy.parameter["type"] = st
73-
if not match_types(st, srccopy, iid, inputobj, linkMerge, valueFrom):
74-
return False
75-
return True
73+
if match_types(sinktype, srccopy, iid, inputobj, linkMerge, valueFrom):
74+
return True
75+
return False
7676
elif linkMerge:
7777
if iid not in inputobj:
7878
inputobj[iid] = []

0 commit comments

Comments
 (0)