@@ -172,7 +172,7 @@ def nested_crossproduct_scatter(
172
172
runtimeContext : RuntimeContext ,
173
173
) -> JobsGeneratorType :
174
174
scatter_key = scatter_keys [0 ]
175
- jobl = len (cast (Sized , joborder [scatter_key ]))
175
+ jobl = len (cast (Sized , joborder [scatter_key ])) if joborder [ scatter_key ] else 0
176
176
output = {} # type: ScatterDestinationsType
177
177
for i in process .tool ["outputs" ]:
178
178
output [i ["id" ]] = [None ] * jobl
@@ -252,7 +252,7 @@ def _flat_crossproduct_scatter(
252
252
) -> Tuple [List [Optional [JobsGeneratorType ]], int ,]:
253
253
"""Inner loop."""
254
254
scatter_key = scatter_keys [0 ]
255
- jobl = len (cast (Sized , joborder [scatter_key ]))
255
+ jobl = len (cast (Sized , joborder [scatter_key ])) if joborder [ scatter_key ] else 0
256
256
steps = [] # type: List[Optional[JobsGeneratorType]]
257
257
put = startindex
258
258
for index in range (0 , jobl ):
@@ -292,7 +292,7 @@ def dotproduct_scatter(
292
292
jobl = None # type: Optional[int]
293
293
for key in scatter_keys :
294
294
if jobl is None :
295
- jobl = len (cast (Sized , joborder [key ]))
295
+ jobl = len (cast (Sized , joborder [key ])) if joborder [ key ] else 0
296
296
elif jobl != len (cast (Sized , joborder [key ])):
297
297
raise WorkflowException (
298
298
"Length of input arrays must be equal when performing "
@@ -729,7 +729,9 @@ def valueFromFunc(
729
729
runtimeContext .postScatterEval = postScatterEval
730
730
731
731
emptyscatter = [
732
- shortname (s ) for s in scatter if len (cast (Sized , inputobj [s ])) == 0
732
+ shortname (s )
733
+ for s in scatter
734
+ if not inputobj [s ] or len (cast (Sized , inputobj [s ])) == 0
733
735
]
734
736
if emptyscatter :
735
737
_logger .warning (
0 commit comments