Split a tree into more branches by value or boolean (not index)

Hello,

I am trying to split a given list of 4 branches into 5 branches list. The first 3 branches are ok, but the last has null values, which mess my script logic. So I need to make two new branches of that 4th branch and use a null (or boolean values) inbetween as their seperator. Hope somebody understand what I am trying to achieve. I have attached an img and a file.

Many thanks!


nullsplit.gh (12.2 KB)

image
forum_splitatnulls.gh (7.5 KB)

more round about than how i’d like it but gets it done.
won’t work on list with no nulls but you probably know how to filter those out and merge back later.