Skip to content

Commit 4e1d601

Browse files
committed
fix: consider that some outputs might not be defined
1 parent 135d900 commit 4e1d601

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nipype/interfaces/mixins/fixheader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ def _post_run_hook(self, runtime):
125125

126126
inputs = self.inputs.get_traitsfree()
127127
outputs = self.aggregate_outputs(runtime=runtime).get_traitsfree()
128-
for out, inp in self._copy_header_map.items():
128+
defined_outputs = set(outputs.keys()).intersection(self._copy_header_map.keys())
129+
for out in defined_outputs:
130+
inp = self._copy_header_map[out]
129131
keep_dtype = True
130132
if isinstance(inp, tuple):
131133
inp, keep_dtype = inp

0 commit comments

Comments
 (0)