Builder crashing when inserting loop

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x):v2022.1.3
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?:

What did you try to make it work?: Add a looping function in builder

What specifically went wrong when you tried that?:
Psychopy reported a crash error, but did not actually crash. The error is as follows:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\”, line 3160, in insertLoop
startII = self.gapMidPoints.index(min(self.entryPointPosList))
ValueError: min() arg is an empty sequence

This is not the first time this crash has happened, but it is not consistently occurring.