Skip to content

Commit c1b60a4

Browse files
stxue1mr-c
authored andcommitted
Deal with none case
1 parent 3197cf8 commit c1b60a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cwltool/command_line_tool.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ def remove_prefix(s: str, prefix: str) -> str:
878878

879879
# If there are environmental variables to preserve, add it to the key
880880
env_var_requirement = cast(dict[str, str], keydict.get("EnvVarRequirement", {}))
881-
env_def = cast(CWLObjectType, self.get_requirement("EnvVarRequirement")[0])
881+
env_def = cast(CWLObjectType, self.get_requirement("EnvVarRequirement")[0] or {})
882882
if runtimeContext.preserve_environment is not None:
883883
env_def.update(JobBase.extract_environment(runtimeContext, env_var_requirement))
884884

0 commit comments

Comments
 (0)