Why does Unreal crash when calling ConstructObjectFromClass node?


This issue has been driving me crazy, Unreal keeps crashing when I call ConstructObjectFromClass on my UObject inheriting class. I tried calling it from onConstruct, BeginPlay or exposing the function manually in editor but it always crash when calling SpawnObject, saying the provided ObjectClass is NULL.

Is this a bug? Am I doing something wrong?


EDIT: The function appears to be called twice. The first time ObjectClass parameter is valid, the second time it’s NULL.
I don’t know why it’s called twice or why it’s invalid the second time…