How should I check if an animation contains an AnimNotify in C++?

In BeginPlay I am iterating over the notifies of an animation to check if it has one named “Notify_InvokeAbility”, the name of a simple notify created in blueprints.

In Begin Play of one of my pawns:

	static const FName InvokeAbilityName(TEXT("Notify_InvokeAbility"));
	for (FAnimNotifyEvent Notify : MyAnimation->Notifies)
		if (Notify.NotifyName == InvokeAbilityName)
			bIsAnimationValid = true;

But I noticed that Notify.NotifyName returns “Notify_InvokeAbility_C”, unless I first open that animation in the Editor, in which case it returns “Notify_InvokeAbility”

What is the correct way of comparing an AnimNotify in C++? Should I create the AnimNotify in code? Should I just check against both names? (“Notify_InvokeAbility” & “Notify_InvokeAbility_C”)

How about: