Skip to content

Commit bc9cc74

Browse files
authored
Fix mergedirs() so it doesn't fail if a Directory object lacks a listing field. (#366)
1 parent c3e48eb commit bc9cc74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cwltool/process.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,8 @@ def mergedirs(listing):
689689
for e in listing:
690690
if e["basename"] not in ents:
691691
ents[e["basename"]] = e
692-
elif e["class"] == "Directory":
693-
ents[e["basename"]]["listing"].extend(e["listing"])
692+
elif e["class"] == "Directory" and e.get("listing"):
693+
ents[e["basename"]].setdefault("listing", []).extend(e["listing"])
694694
for e in ents.itervalues():
695695
if e["class"] == "Directory" and "listing" in e:
696696
e["listing"] = mergedirs(e["listing"])

0 commit comments

Comments
 (0)