Working with UMG using C++?

SOLVED

I know the error is occuring because of these lines:

If I remove them, everything runs fine. So I guess it is because of how I’m calling/referencing it. There is a UInventoryHUD class which contains the function like this:

All the function does is return ItemName. Then the blueprint is suppose to pick that up. The engine keeps crashing with this error:

Removing those two lines does not result in the error.

Also, if you mean the widget UI designer by “Drag and Drop”, then I am in fact using that.