We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 166e06c commit 0e3ea76Copy full SHA for 0e3ea76
nipype/interfaces/io.py
@@ -1242,8 +1242,11 @@ def _list_outputs(self):
1242
if self.inputs.sort_filelist:
1243
outfiles = human_order_sorted(outfiles)
1244
outputs[key].append(list_to_filename(outfiles))
1245
- if any([val is None for val in outputs[key]]):
1246
- outputs[key] = []
+ if self.inputs.raise_on_empty: # if the raise_on_empty is True by default, make sure no None in outputs
+ if any([val is None for val in outputs[key]]):
1247
+ outputs[key] = []
1248
+ else: # if the raise_on_empty is False remove the Nones in outputs
1249
+ outputs[key] = [[] if x is None else x for x in outputs[key]]
1250
if len(outputs[key]) == 0:
1251
outputs[key] = None
1252
elif len(outputs[key]) == 1:
0 commit comments