agent and ?agent in the same function?

How do you guys work around this?
when i want to subscribe to the function it asks me to have it as type of ?agent
like here in the image


and when I change it to ?agent i get this error in the function

? means it could have a value or be null, so you need to check if its valid first.

if:
    ValidAgent := Agent?,
    Char:fort_character = ValidAgent.GetFortCharacter[]
then:
    Char.SetHealth(Char.GetHealth() + 25.0)

amazing thank you