diff --git a/cwltool/process.py b/cwltool/process.py index 245c9f817..fcf78615a 100644 --- a/cwltool/process.py +++ b/cwltool/process.py @@ -344,6 +344,8 @@ def formatSubclassOf(fmt, cls, ontology, visited): def checkFormat(actualFile, inputFormats, ontology): # type: (Union[Dict[Text, Any], List, Text], Union[List[Text], Text], Graph) -> None for af in aslist(actualFile): + if not af: + continue if "format" not in af: raise validate.ValidationException(u"Missing required 'format' for File %s" % af) for inpf in aslist(inputFormats): diff --git a/cwltool/workflow.py b/cwltool/workflow.py index 4ab5b2bbc..2ad4badeb 100644 --- a/cwltool/workflow.py +++ b/cwltool/workflow.py @@ -66,13 +66,13 @@ def match_types(sinktype, src, iid, inputobj, linkMerge, valueFrom): return True elif isinstance(src.parameter["type"], list): # Source is union type - # Check that every source type is compatible with the sink. + # Check that at least one source type is compatible with the sink. for st in src.parameter["type"]: srccopy = copy.deepcopy(src) srccopy.parameter["type"] = st - if not match_types(st, srccopy, iid, inputobj, linkMerge, valueFrom): - return False - return True + if match_types(sinktype, srccopy, iid, inputobj, linkMerge, valueFrom): + return True + return False elif linkMerge: if iid not in inputobj: inputobj[iid] = []