Make Curve Modifier for not closed curve that has an end and a start that can't communicate

I would like to know what can I change in the code of flow.js to prevent meshes to instance between the end and the start of the curve. For now even if the curve has closed = false the mesh at the end is starting again at the beginning.
Many thanks for your help!