[1] UActorComponent* USCS_Node::GetActualComponentTemplate(UBlueprintGeneratedClass* ActualBPGC) const crashes because ActualBPGC is nullptr.
[2] It is nullptr since previous call has a failed Cast.
if (ComponentTemplate->HasAnyFlags(RF_InheritableComponentTemplate))
{
ObjectToCompare = Node->GetActualComponentTemplate(Cast<UBlueprintGeneratedClass>(BPGC->GetSuperClass()));
}
The cast here failed since BPGC's super class is a C++ class, not BP generated class, so it failed.
[3] This node is the DefaultSceneRoot of this Actor; this Actor is of BP class, and it’s parent is a C++ class.
I’m not sure how to modify the code to make it work, but I suspect that this is kind of buggy, since BPGC's super class is not guaranteed to be BP generated.
I’d highly recommend replacing the DefaultSceneRoot with a Scene Component, as this is typically what I’d do with my own setups.
However, as there is a crash occurring, could you please provide a detailed list of repro steps or a project that is crashing so that we can get a bug entered for this, as a crash is never intended behavior. Thanks!
Package the project with this kind of class, with Nativize enabled of course, then you might encounter this crash. I say ‘might’ since it looks like not every Actor with this setup make Nativize packaging crash, but at least I replaced many DefaultSceneRoot with Scene and there becomes no such crash.
I have been unable to reproduce the crash following the steps you’ve provided. If you have a simplified test project that is experiencing the crash, please zip it up, upload it to Dropbox, and provide a download link. Then we can go ahead and get a bug report entered.
I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.