AI pointing to dead character

I hope this will be my last question,

So I did as you said :

TSharedPtr minionPtr(OwnerComp.GetBlackboardComponent()->GetValue<UBlackboardKeyType_Object>(MinionPC->EnemyKeyID));

But now I get an error C2955 : ‘TSharedPtr’: use of class template requires template arguments list.

so I went to take a look at the declaration and here is what I found:

mutable class TSharedPtr<struct FKeyDetails> KeyDetails;

I’m really trying to make sens of all this but this is basically chinese to me.