UMaterialInstanceDynamic::Create( causes crash if a NULL MaterialInterface is passed in.
Dear Friends at Epic,
Can you check out UMaterialInstanceDynamic::Create( and make sure it handles being passed in a UMaterialInterface* that is NULL in the correct manner?
I sometimes get a crash on the rendering thread when passing in a NULL material (it was not intentional of course, but when it crashes, it doesn't explain what the problem is at all, in the log)
This is just one more step to be make Engine able to handle CPP user-error without crashing
had to become this
Where to Start Looking
The most relevant code is right here (abbreviated for legal reasons)
My Best Guess at the Issue
In the case when the NewParent is NULL, the InitResources() is still running.
The overall process should probably exit more cleanly, maybe even in the MaterialInstanceDynamic::Create(, and never running SetParentInternal.
UMaterialInstanceDynamic::Create( is crashing when the material to make the materian instance dynamic from was NULL
I have experienced reproduceable crashes related to passing in NULL for ::Create( so please check this out
You may have to run the code several times to get the crash, for me it is between 1 and 3 runs of the code during runtime before the crash occurs.
Follow this question
Once you sign in you will be able to subscribe for any updates here