0

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

Aqeel Tariq
  • 315
  • 1
  • 8
  • Note that it is *not* `stopDelay` which throws the error. `stopDelay` takes the agent to stop the delay for; it is your attempt to get the first agent from an empty Delay block (`delay.get(0)`) that causes the error (and it should hopefully be intuitive that that would cause an error). – Stuart Rossiter Nov 14 '21 at 17:29

1 Answers1

0

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)); 
}
Felipe
  • 8,311
  • 2
  • 15
  • 31