TMap FindChecked assertion with valid data
I have the following code set up in a UDataAsset subclass:
As objects of the Key type are created/removed, the map automatically updates itself to have 1 entry per object. The values are then set in a DataAsset in the editor. In my test case, I have 3 key objects and 3 value objects - in the DataAsset I assign 1 value per key.
I then have a unit test that runs in GameInstance::Init() with the following code:
I do this for all the skills/masteries, and the pointers are all valid and I can access them and everything is great.
Finally, during the unit test I make the following calls:
Sometimes the call with Chain asserts false in FindChecked (the  operator), sometimes it doesn't. If I change the DataAsset in the editor from Invalid to Basic and back to Invalid, it seems to no longer crash, but some time later it will start crashing again consistently, until it decides it's done crashing and it won't do it again for hours. I've also ran the following code:
This code executes perfectly fine, and then immediately crash a few lines later when it gets to the  operator. In fact, Skill and X.Key produce the same exact pointer value, and X.Value resolves properly without any nullptr issues. So I know that both the Key and Value are valid pointers, but for some reason FindChecked() is failing regardless.
Any thoughts at all would be appreciated.
ChainFinder.Object is the prototype of the class, it's not supposed to be used. You're supposed to create an instance of the class that you get back from FObjectFinder.
FYI there's another option to FObjectFinder -- which I used to myself before I learned about this: Change your Chain declaration to
Just like with FObjectFinder, you still need to create a new object from the class.
Follow this question
Once you sign in you will be able to subscribe for any updates here