If the general behaviour changes as a result of adding a guard against a nil value that causes a crash, even in situations when you would not get a crash, the only reasonable assumption is that you're not setting up the guard correctly.ilovelove2019 wrote: ↑Mon Oct 07, 2019 12:53 pm I mean if I use guard. When I threw the cherry bombs at the frogs, they didn't take any damage. The code after putting into guard it does not work. I do not understand why?
If something goes wrong only in the exact same situation where the crash would otherwise happen, then the guard would not be the solution, But judging by the symptoms, at least in the case I have analysed, guarding against a nil value should prevent problems.