diff --git a/docs/nodes/list_masks/mask_join.rst b/docs/nodes/list_masks/mask_join.rst index 2cab98d152..c0537e8867 100644 --- a/docs/nodes/list_masks/mask_join.rst +++ b/docs/nodes/list_masks/mask_join.rst @@ -42,7 +42,7 @@ In the N-Panel (and on the right-click menu) you can find: Outputs ------- -* **Data:** Mixed data of the incoming data, the length of Outputs depends on the **Data True**, **Data False** and **Mask** list lengths. +* **Data:** Mixed data of the incoming data, the length of Outputs depends on the **Data True**, **Data False** and **Mask** list lengths. If, at the choice level, the node encounters true and false input lists simultaneously empty, the corresponding output is an empty list. If only one of the two is empty, then values chosen from the other by the mask are replaced by None. Example ------- diff --git a/nodes/list_masks/mask_join.py b/nodes/list_masks/mask_join.py index 3176a1ca1e..a49f42e2a6 100644 --- a/nodes/list_masks/mask_join.py +++ b/nodes/list_masks/mask_join.py @@ -80,7 +80,12 @@ def process(self): def apply_choice_mask(self, mask, data_t, data_f): out = [] - param = list_match_func[self.list_match_global]([mask, data_t, data_f]) + if len(data_t) == 0: + data_t = [None] * len(data_f) + elif len(data_f) == 0: + data_f = [None] * len(data_t) + + param = list_match_func[self.list_match_global]([mask, data_t, data_f]) for m, t, f in zip(*param): if m: out.append(t)