FBodyInstance::GetCOMPosition crashes Blueprint editor

Hi!

I’m working on a component that extends USkeletalMeshComponent and during TickComponent() I’m getting the position of each physics body using Body->GetCOMPosition(). This works great in-game, PIE or otherwise, however crash every time I open the full Blueprint editor for my character that uses this component. The actual pointer to the Body is valid, it’s just the GetCOMPosition method that’s the issue.

Could this be due to the PhysX body instance not fully existing, or not existing at all, in the BP editor and there being nothing in the method to check that?
And, since I don’t need the code to run in the BP editor, is there anyway to disable my Tick code when not playing to avoid this issue?

Thanks a lot!

Engine function:
https://github.com/EpicGames/UnrealEngine/blob/4.13/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodyInstance.cpp#L3021

In the end I found WorldType in UWorld which allows me to check what kind of world is currently active and act accordingly. So to stop executing the custom physics behaviour if it’s in the map editor or BP editor I use:

#if WITH_EDITOR
	if (GetWorld()->WorldType == EWorldType::Preview || GetWorld()->WorldType == EWorldType::Editor) return;
#endif