I have an event with action
delay.stopDelay(delay.get(0));
it works fine but when the delay block gets empty error shows up enter image description here
that's because your delay doesn't have any agent inside
so you need to do the following:
if(delay.size()>0){
delay.stopDelay(delay.get(0));
}