Abort task when stop playing crashes editor

So here’s my problem.
My AI is casting some attack ( running a specific task). In my Task I handle abort event, as it finishes aborting only if the cast is over (I just check if the State “castingAttack” of my AICharacter is not active).
If I stop playing while the AI was casting an attack, the editor crashes, saying that I try to access to a nullptr. which is the AICharacter. What I understand, is that the cast attack cast receive the abort event when I stop playing, but the AICharacter was already destroy.
How can I handle this problem, without checking if the AICharacter is valid on every Task?

bump.